import { jsx as _jsx } from "react/jsx-runtime";
import { useContext } from 'react';
import { RadioField } from '../RadioField';
import { RadioGroupContext } from '../RadioGroup';
/**
 * Компонент RadioField, адаптирован под использование внутри RadioGroup,
 * Использует контекст RadioGroupContext
 */
export const RadioGroupField = (props) => {
    const { isError, value, name, onChange, disabled } = useContext(RadioGroupContext);
    return (_jsx(RadioField, { ...props, isError: isError, name: name, disabled: disabled, onChange: (event) => onChange?.(event, event.target.value), checked: value === props.value }));
};
