import React from 'react'; import { X } from 'lucide-react'; import { Button } from '@/components/ui/button'; interface CustomDialogProps { isOpen: boolean; onClose: () => void; title: string; description?: string; children: React.ReactNode; allowClose?: boolean; isPending?: boolean; } const CustomDialog: React.FC = ({ isOpen, onClose, title, description, children, allowClose = true, isPending = false, }) => { if (!isOpen) return null; const handleOverlayClick = (e: React.MouseEvent) => { // Only allow closing if explicitly enabled and not pending if (allowClose && !isPending && e.target === e.currentTarget) { onClose(); } }; return (
{/* Overlay */}
{/* Modal Content */}
{/* Header */}

{title}

{description &&

{description}

}
{/* Body - Add auto overflow to allow content to scroll */}
{children}
{/* Close button - only if allowed */} {allowClose && !isPending && ( )}
); }; export default CustomDialog;