"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RadioGroupField = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const RadioField_1 = require("../RadioField");
const RadioGroup_1 = require("../RadioGroup");
/**
 * Компонент RadioField, адаптирован под использование внутри RadioGroup,
 * Использует контекст RadioGroupContext
 */
const RadioGroupField = (props) => {
    const { isError, value, name, onChange, disabled } = (0, react_1.useContext)(RadioGroup_1.RadioGroupContext);
    return ((0, jsx_runtime_1.jsx)(RadioField_1.RadioField, { ...props, isError: isError, name: name, disabled: disabled, onChange: (event) => onChange?.(event, event.target.value), checked: value === props.value }));
};
exports.RadioGroupField = RadioGroupField;
