import { useEffect } from 'react'; import { createPortal } from 'react-dom'; import { X } from 'lucide-react'; export const CustomModal = ({ isOpen, onClose, title, description, children, footer, maxWidth = "max-w-md" }) => { useEffect(() => { if (isOpen) { document.body.style.overflow = 'hidden'; } else { document.body.style.overflow = 'unset'; } return () => { document.body.style.overflow = 'unset'; }; }, [isOpen]); if (!isOpen) return null; return createPortal(
{/* Header */}

{title}

{description &&

{description}

}
{/* Body */} {children && (
{children}
)} {/* Footer */} {footer && (
{footer}
)}
, document.body ); };