import type { PropsWithChildren } from 'react'; import { useCallback } from 'react'; import Toggle from 'react-toggle'; interface Props { checked: boolean; disabled?: boolean; onChange: (checked: boolean) => void; } export const CheckboxWithLabel: React.FC> = ({ checked, disabled, children, onChange, }) => { const handleChange = useCallback( ({ target }: React.ChangeEvent) => { onChange(target.checked); }, [onChange], ); return ( ); };