import { Checkbox, } from '@chakra-ui/react'; import React from 'react'; import type { ControllerRenderProps, FieldValues, Path } from 'react-hook-form'; type Props> = { field: ControllerRenderProps; text: string; onChange?: () => void; isDisabled?: boolean; } export default function CheckboxInput>( { field, text, onChange, isDisabled, }: Props) { const handleChange: typeof field.onChange = React.useCallback((...args) => { field.onChange(...args); onChange?.(); }, [ field, onChange ]); return ( { text } ); }