import { jsx as _jsx } from "react/jsx-runtime";
import { Controller } from "react-hook-form";
import { Checkbox, FormControlLabel } from "@mui/material";
import "./style.scss";
export default function CheckboxField({ attr, label, createdForm, disabled = false, }) {
    const fieldName = attr;
    const { control } = createdForm;
    return (_jsx(Controller, { name: fieldName, control: control, render: ({ field }) => (_jsx(FormControlLabel, { className: "ds-checkbox", disabled: disabled, control: _jsx(Checkbox, { ...field, checked: !!field.value, onChange: (e) => field.onChange(e.target.checked) }), label: label })) }));
}
