import { Dialog, Transition } from "@headlessui/react"; import { Fragment } from "react"; import { useModal } from "~/providers/modal"; interface Props { children: React.ReactNode; modalSize?: "sm" | "md" | "lg"; positionFromTop?: "sm" | "md" | "lg"; isVisible?: boolean; } const Modal: React.FC = ({ children, modalSize = "sm", positionFromTop = "md", isVisible, }) => { const { isOpen, closeModal } = useModal(); const shouldShow = isVisible !== undefined ? isVisible : isOpen; const modalSizeMap = { sm: "max-w-[400px]", md: "max-w-[550px]", lg: "max-w-[800px]", }; const positionFromTopMap = { sm: "mt-[12vh]", md: "mt-[25vh]", lg: "mt-[50vh]", }; return (
{children}
); }; export default Modal;