import { jsx as _jsx } from "react/jsx-runtime";
import { SegmentedRadioGroup as SegmentedRadioGroupUIKIT } from '@gravity-ui/uikit';
import { getValueByPath } from "../../utils/fields.js";
import Base from "../Base/Base.js";
import BaseInput from "../BaseInput/BaseInput.js";
const SegmentedRadioGroup = ({ title, name, options, when, content, onUpdate, defaultValue, }) => {
    const selected = content ? getValueByPath(content, name) : undefined;
    const value = selected ?? defaultValue ?? null;
    return (_jsx(Base, { when: when, content: content, name: name, onUpdate: onUpdate, defaultValue: defaultValue, children: _jsx(BaseInput, { title: title, children: _jsx(SegmentedRadioGroupUIKIT, { name: name, options: options, onUpdate: (v) => onUpdate(name, v), value: value }) }) }));
};
export default SegmentedRadioGroup;
//# sourceMappingURL=SegmentedRadioGroup.js.map
