"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "AlertDialog", {
    enumerable: true,
    get: function() {
        return AlertDialog;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _dialog = require("../dialog/dialog");
const _react = require("react");
const _button = /*#__PURE__*/ _interop_require_default(require("../button"));
const _modal = require("../modal");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
const AlertDialog = (props)=>{
    const { title, message } = props;
    const { visible, hide, resolve, reject, onOpenChange } = (0, _modal.useModal)();
    const onOk = (0, _react.useCallback)(()=>{
        hide();
    }, [
        props.onOk
    ]);
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_dialog.Dialog, {
        open: visible,
        onOpenChange: onOpenChange,
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_dialog.DialogHeader, {
                children: title
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_dialog.DialogContent, {
                children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_dialog.DialogBody, {
                    children: message
                })
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_dialog.DialogFooter, {
                children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_button.default, {
                    onClick: onOk,
                    children: "Ok"
                })
            })
        ]
    });
};

//# sourceMappingURL=alertDialog.js.map