import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader } from "../dialog/dialog";
import { useCallback } from "react";
import Button from "../button";
import { useModal } from "../modal";
export const AlertDialog = (props)=>{
    const { title, message } = props;
    const { visible, hide, resolve, reject, onOpenChange } = useModal();
    const onOk = useCallback(()=>{
        hide();
    }, [
        props.onOk
    ]);
    return /*#__PURE__*/ _jsxs(Dialog, {
        open: visible,
        onOpenChange: onOpenChange,
        children: [
            /*#__PURE__*/ _jsx(DialogHeader, {
                children: title
            }),
            /*#__PURE__*/ _jsx(DialogContent, {
                children: /*#__PURE__*/ _jsx(DialogBody, {
                    children: message
                })
            }),
            /*#__PURE__*/ _jsx(DialogFooter, {
                children: /*#__PURE__*/ _jsx(Button, {
                    onClick: onOk,
                    children: "Ok"
                })
            })
        ]
    });
};

//# sourceMappingURL=alertDialog.js.map