"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfirmDialog = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const core_1 = require("@material-ui/core");
const UICheckbox_1 = require("./BuildlingBlocks/UICheckbox");
const react_1 = require("react");
const UIFormControlLabel_1 = require("./BuildlingBlocks/UIFormControlLabel");
const UIStandardLayer_1 = require("./BuildlingBlocks/UIStandardLayer");
const UILabel_1 = require("./BuildlingBlocks/UILabel");
const ConfirmDialog = ({ onConfirm, onCancel, caption, open, action, }) => {
    const [dontAskAgain, setDontAskAgain] = (0, react_1.useState)(false);
    return ((0, jsx_runtime_1.jsx)(UIStandardLayer_1.UIStandardLayer, { open: open, onClose: onCancel, onSet: () => {
            onConfirm(dontAskAgain);
        }, title: "Confirm  " + (action ?? "Delete") + " " + (caption ?? "this"), actionText: "Yes", secondaryAction: () => {
            onCancel();
        }, secondaryActionText: "Cancel", renderLayer: () => {
            return ((0, jsx_runtime_1.jsxs)(core_1.DialogContent, { children: [(0, jsx_runtime_1.jsxs)(UILabel_1.UILabel, { children: ["Are you sure to want to ", action || "delete", " ", caption || "this", "?"] }), (0, jsx_runtime_1.jsx)(UIFormControlLabel_1.UIFormControlLabel, { label: "Don't Ask Again?", control: (0, jsx_runtime_1.jsx)(UICheckbox_1.StyledCheckBox, { color: "primary", checked: dontAskAgain, onChange: (event) => setDontAskAgain(event.target.checked) }) })] }));
        } }));
};
exports.ConfirmDialog = ConfirmDialog;
//# sourceMappingURL=ConfirmDialog.js.map