import React from 'react'; import { AlertCircle, CheckCircle, Trash2, AlertTriangle } from 'lucide-react'; import Modal from './Modal'; interface ConfirmModalProps { isOpen: boolean; onClose: () => void; onConfirm: () => void; title: string; message: string; confirmText?: string; cancelText?: string; variant?: 'danger' | 'warning' | 'info' | 'success'; isLoading?: boolean; } export default function ConfirmModal({ isOpen, onClose, onConfirm, title, message, confirmText = 'Confirm', cancelText = 'Cancel', variant = 'danger', isLoading = false, }: ConfirmModalProps) { const handleConfirm = () => { onConfirm(); if (!isLoading) { onClose(); } }; const variantConfig = { danger: { icon: Trash2, iconColor: 'text-red-500', iconBg: 'bg-red-500/10', buttonColor: 'bg-red-600 hover:bg-red-700', }, warning: { icon: AlertTriangle, iconColor: 'text-yellow-500', iconBg: 'bg-yellow-500/10', buttonColor: 'bg-yellow-600 hover:bg-yellow-700', }, info: { icon: AlertCircle, iconColor: 'text-blue-500', iconBg: 'bg-blue-500/10', buttonColor: 'bg-blue-600 hover:bg-blue-700', }, success: { icon: CheckCircle, iconColor: 'text-green-500', iconBg: 'bg-green-500/10', buttonColor: 'bg-green-600 hover:bg-green-700', }, }; const config = variantConfig[variant]; const Icon = config.icon; return (
{/* Icon */}
{/* Title */}

{title}

{/* Message */}

{message}

{/* Buttons */}
); }