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