"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BooleanRadioEditor = void 0;
var react_1 = __importDefault(require("react"));
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var classnames_1 = __importDefault(require("classnames"));
var ramda_1 = require("ramda");
var FormControlLabel_1 = __importDefault(require("@mui/material/FormControlLabel"));
var BooleanEditor_1 = require("./components/BooleanEditor");
var styles_1 = require("./styles");
var BooleanRadioEditor = function (_a) {
    var _b;
    var value = _a.value, onChange = _a.onChange, className = _a.className, isCrossedOut = _a.isCrossedOut, disabled = _a.disabled;
    var styles = (0, styles_1.useStyles)();
    return (react_1.default.createElement("div", { className: className },
        react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.editors, (_b = {}, _b[styles.isCrossedOut] = isCrossedOut, _b)) },
            react_1.default.createElement(FormControlLabel_1.default, { classes: { label: styles.label }, control: react_1.default.createElement(BooleanEditor_1.BooleanEditor, { classes: { root: styles.checkboxPrimary }, color: "primary", value: !(0, ramda_1.isNil)(value) && !!value, onChange: onChange, disabled: disabled }), label: ui_i18n_1.default.text('Yes') }),
            react_1.default.createElement(FormControlLabel_1.default, { classes: { label: styles.label }, control: react_1.default.createElement(BooleanEditor_1.BooleanEditor, { classes: { root: styles.checkboxPrimary }, color: "primary", value: !(0, ramda_1.isNil)(value) && !value, onChange: onChange && (0, ramda_1.pipe)(ramda_1.not, onChange), disabled: disabled }), label: ui_i18n_1.default.text('No') }))));
};
exports.BooleanRadioEditor = BooleanRadioEditor;
