import React from 'react'; import { X, AlertCircle } from 'lucide-react'; import { Button } from '@/components/ui/button'; interface CustomConfirmDialogProps { isOpen: boolean; onClose: () => void; onConfirm: () => void; title: string; description?: string | React.ReactNode; confirmText?: string; cancelText?: string; variant?: 'destructive' | 'default' | 'outline' | 'secondary' | 'ghost' | 'link'; isLoading?: boolean; } const CustomConfirmDialog: React.FC = ({ isOpen, onClose, onConfirm, title, description, confirmText = 'Confirm', cancelText = 'Cancel', variant = 'destructive', isLoading = false, }) => { if (!isOpen) return null; const handleOverlayClick = (e: React.MouseEvent) => { // Only allow closing if not in loading state if (!isLoading && e.target === e.currentTarget) { onClose(); } }; return (
{/* Overlay */}
{/* Modal Content */}
{variant === 'destructive' && (
)}

{title}

{description && ( typeof description === 'string' ?

{description}

:
{description}
)}
{/* Close button */} {!isLoading && ( )}
); }; export default CustomConfirmDialog;