import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, } from '@/components/ui/dialog'; import { cn } from '@/lib/utils'; // Size → Tailwind max-width on >=sm screens. Mobile is always nearly full-width. const SIZE_CLASS = { sm: 'sm:max-w-sm', md: 'sm:max-w-lg', lg: 'sm:max-w-2xl', xl: 'sm:max-w-4xl', '2xl': 'sm:max-w-6xl', }; export default function Modal({ open, onClose, title, children, footer, className = '', size = 'md', }) { const sizeClass = SIZE_CLASS[size] || SIZE_CLASS.md; return ( !v && onClose()}> {title && ( {title} )}
{children}
{footer && ( {footer} )}
); }