import { Fragment, ReactNode } from 'react' import { Dialog, Transition } from '@headlessui/react' import clsx from 'clsx' // From https://tailwindui.com/components/application-ui/overlays/modals export function Modal(props: { children: ReactNode open: boolean setOpen: (open: boolean) => void size?: 'sm' | 'md' | 'lg' | 'xl' className?: string }) { const { children, open, setOpen, size = 'md', className } = props const sizeClass = { sm: 'max-w-sm', md: 'max-w-md', lg: 'max-w-2xl', xl: 'max-w-5xl', }[size] return (
{/* This element is to trick the browser into centering the modal contents. */}
{children}
) }