import { jsx as _jsx } from "react/jsx-runtime";
import { useEffect } from "react";
import { Modal } from "../../../components/molecules/Modal";
import { Button } from "../../../components/atoms/Button";
export const ModalFull = ({ isOpen, onClose, title, children, footer, size = "md", className, showCloseButton = true, }) => {
    // Keyboard navigation
    useEffect(() => {
        if (!isOpen)
            return;
        const handleKeyDown = (e) => {
            if (e.key === "Escape") {
                onClose();
            }
        };
        window.addEventListener("keydown", handleKeyDown);
        return () => {
            window.removeEventListener("keydown", handleKeyDown);
        };
    }, [isOpen, onClose]);
    return (_jsx(Modal, { isOpen: isOpen, onClose: onClose, title: title, size: size, className: className, footer: footer ||
            (showCloseButton && (_jsx(Button, { variant: "outline", onClick: onClose, children: "Close" }))), children: children }));
};
export default ModalFull;
