"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormCheckboxField = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const CheckboxField_1 = require("../../components/CheckboxField");
const forwardRefWithGeneric_1 = require("../../components/forwardRefWithGeneric");
const useFormFieldProps_1 = require("../useFormFieldProps");
/**
 * Адаптер для CheckboxField
 */
const FormCheckboxFieldInner = ({ success, hideHelperText = false, ...restProps }, ref) => {
    const { title = '', value, error, ...restFieldProps } = (0, useFormFieldProps_1.useFormFieldProps)({
        ...restProps,
        defaultValue: restProps.defaultValue ||
            null,
    });
    return ((0, jsx_runtime_1.jsx)(CheckboxField_1.CheckboxField, { label: title, checked: Boolean(value), hideHelperText: hideHelperText, isSuccess: success, isError: error, ...restFieldProps, ref: ref }));
};
exports.FormCheckboxField = (0, forwardRefWithGeneric_1.forwardRefWithGeneric)(FormCheckboxFieldInner);
