'use client'; import { ReactNode, useEffect } from 'react'; import { cn } from '@/lib/utils'; interface ModalProps { isOpen: boolean; onClose: () => void; title: string; children: ReactNode; className?: string; } export function Modal({ isOpen, onClose, title, children, className }: ModalProps) { useEffect(() => { const handleEscape = (e: KeyboardEvent) => { if (e.key === 'Escape') { onClose(); } }; if (isOpen) { document.addEventListener('keydown', handleEscape); document.body.style.overflow = 'hidden'; } return () => { document.removeEventListener('keydown', handleEscape); document.body.style.overflow = 'unset'; }; }, [isOpen, onClose]); if (!isOpen) return null; return (