import type { ModalProps } from "$/types/Modal"; import { Dialog, DialogBackdrop, DialogPanel } from "@headlessui/react"; import clsx from "clsx"; export default function Modal(props: ModalProps){ const { display, onClose, className, backgroundType = "blur", top, children } = props; return ( {/* Backdrop as fixed sibling to the panel */} { backgroundType !== "none" && } {/* Full-screen container to center the panel */}
{/* The actual modal panel */} {/* Content of the modal */} {children}
); }