import { ReactNode, useEffect } from 'react' import { X } from 'lucide-react' import { cn } from '@/lib/utils' type ModalProps = { isOpen: boolean onClose: () => void title?: string children: ReactNode size?: 'sm' | 'md' | 'lg' | 'xl' | 'full' className?: string showCloseButton?: boolean } const sizeStyles = { sm: 'max-w-md', md: 'max-w-2xl', lg: 'max-w-4xl', xl: 'max-w-6xl', full: 'max-w-full', } export function Modal({ isOpen, onClose, title, children, size = 'md', className, showCloseButton = true }: ModalProps) { useEffect(() => { if (isOpen) { document.body.style.overflow = 'hidden' } else { document.body.style.overflow = '' } return () => { document.body.style.overflow = '' } }, [isOpen]) if (!isOpen) return null return (
e.stopPropagation()} > {title && (

{title}

{showCloseButton && ( )}
)}
{children}
) }