import {type ChangeEvent, useEffect, useRef} from "react"; type CheckBoxProps = { id: string; name: string; checked: boolean; onChange: (checked: boolean) => void; value?: string; label?: string; disabled?: boolean; indeterminate?: boolean; }; export const CheckBox = ({ id, name, checked, onChange, value, label, disabled = false, indeterminate = false, }: CheckBoxProps) => { const inputRef = useRef(null); useEffect(() => { if (!inputRef.current) { return; } inputRef.current.indeterminate = indeterminate; }, [indeterminate]); const handleChange = (event: ChangeEvent) => { onChange(event.target.checked); }; return ( <> ); };