"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const uikit_1 = require("@gravity-ui/uikit");
const fields_1 = require("../../utils/fields.js");
const Base_1 = tslib_1.__importDefault(require("../Base/Base.js"));
const BaseInput_1 = tslib_1.__importDefault(require("../BaseInput/BaseInput.js"));
const Switch = ({ title, when, name, content, onUpdate, className, defaultValue }) => {
    const value = (0, fields_1.getValueByPath)(content, name) ?? defaultValue ?? false;
    return ((0, jsx_runtime_1.jsx)(Base_1.default, { content: content, when: when, onUpdate: onUpdate, children: (0, jsx_runtime_1.jsx)(BaseInput_1.default, { title: title, className: className, children: (0, jsx_runtime_1.jsx)(uikit_1.Switch, { name: name, onUpdate: (v) => onUpdate(name, v), checked: value }) }) }));
};
exports.default = Switch;
//# sourceMappingURL=Switch.js.map
