import { jsx as _jsx } from "react/jsx-runtime";
import { Controller } from "react-hook-form";
import { Checkbox, CheckboxLabel } from "../Checkbox.native.js";
import { useFormContext } from "./context.native.js";
function FormCheckbox(param) {
  var {
      id,
      label,
      ...props
    } = param,
    {
      control
    } = useFormContext();
  return /* @__PURE__ */_jsx(Controller, {
    control,
    name: id,
    render: function (param2) {
      var {
        field
      } = param2;
      return label ? /* @__PURE__ */_jsx(CheckboxLabel, {
        ...props,
        label,
        checked: field.value,
        onChange: field.onChange
      }) : /* @__PURE__ */_jsx(Checkbox, {
        ...props,
        checked: field.value,
        onChange: field.onChange
      });
    }
  });
}
export { FormCheckbox };
//# sourceMappingURL=FormCheckbox.native.js.map
