import { Fragment } from 'react'; import { Dialog, Transition } from '@headlessui/react'; import { XMarkIcon } from '@heroicons/react/24/outline'; interface ModalProps { isOpen: boolean; onClose: () => void; title: string; children: React.ReactNode; maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl'; } export default function Modal({ isOpen, onClose, title, children, maxWidth = 'md' }: ModalProps) { const maxWidthClass = { sm: 'sm:max-w-sm', md: 'sm:max-w-md', lg: 'sm:max-w-lg', xl: 'sm:max-w-xl', '2xl': 'sm:max-w-2xl', '3xl': 'sm:max-w-3xl', '4xl': 'sm:max-w-4xl', '5xl': 'sm:max-w-5xl', }[maxWidth]; return (
{title}
{children}
); }