import React from 'react'; import { Modal } from './Modal.tsx'; interface ConfirmDialogProps { isOpen: boolean; onClose: () => void; onConfirm: () => void; title?: string; message: string; type?: 'info' | 'warning' | 'danger'; confirmText?: string; cancelText?: string; isDestructive?: boolean; } export const ConfirmDialog: React.FC = ({ isOpen, onClose, onConfirm, title, message, type = 'info', confirmText, cancelText = 'Cancel', isDestructive = false }) => { const getIcon = () => { switch (type) { case 'danger': return '⚠️'; case 'warning': return '⚠️'; default: return '❓'; } }; const getTitle = () => { if (title) return title; switch (type) { case 'danger': return 'Confirm Deletion'; case 'warning': return 'Confirm Action'; default: return 'Confirm'; } }; const getConfirmText = () => { if (confirmText) return confirmText; switch (type) { case 'danger': return 'Delete'; case 'warning': return 'Continue'; default: return 'Confirm'; } }; const handleConfirm = () => { onConfirm(); onClose(); }; return (
{getIcon()}

{message}

); };