import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRefWithGeneric } from '../../components/forwardRefWithGeneric';
import { RadioGroup } from '../../components/RadioGroup';
import { useFormFieldProps } from '../useFormFieldProps';
/**
 * Адаптер RadioGroup для формы
 */
const FormRadioGroupInner = (props, ref) => {
    const { errorText, isError, ...withoutErrorProps } = props;
    const { error, helperText, inputRef, children, ...fieldProps } = useFormFieldProps({
        ...withoutErrorProps,
        defaultValue: withoutErrorProps.defaultValue ||
            null,
    });
    return (_jsx(RadioGroup, { isError: error, errorText: helperText, ...fieldProps, ref: ref, inputRef: inputRef, children: children }));
};
export const FormRadioGroup = forwardRefWithGeneric(FormRadioGroupInner);
