import { Controller, useFormContext, type FieldPath, type FieldValues, } from "react-hook-form"; import FormControlLabel from "@mui/material/FormControlLabel"; import { Checkbox } from "@/Components/inputs"; interface FormCheckboxFieldProps { name: FieldPath; label: string; } export const FormCheckboxField = ({ name, label, }: FormCheckboxFieldProps) => { const { control } = useFormContext(); return ( ( field.onChange(e.target.checked)} /> } label={label} /> )} /> ); };