ol-form-switch.tsx 489 B

1234567891011121314151617181920
  1. import { FormCheck, FormCheckProps, FormLabel } from 'react-bootstrap'
  2. type OLFormSwitchProps = FormCheckProps & {
  3. inputRef?: React.MutableRefObject<HTMLInputElement | null>
  4. }
  5. function OLFormSwitch(props: OLFormSwitchProps) {
  6. const { inputRef, label, id, ...rest } = props
  7. return (
  8. <>
  9. <FormCheck type="switch" ref={inputRef} id={id} {...rest} />
  10. <FormLabel htmlFor={id} visuallyHidden>
  11. {label}
  12. </FormLabel>
  13. </>
  14. )
  15. }
  16. export default OLFormSwitch