import { Button } from '@/components/ui/Button'; import { ModalPortal } from '@/components/ui/ModalPortal'; import { IconX, IconAlertTriangle } from '@tabler/icons-solidjs'; interface ConfirmModalProps { isOpen: boolean; onClose: () => void; onConfirm: () => void; title: string; message: string; confirmText?: string; cancelText?: string; type?: 'danger' | 'warning' | 'info'; } export const ConfirmModal = (props: ConfirmModalProps) => { const { isOpen, onClose, onConfirm, title, message, confirmText = 'Confirm', cancelText = 'Cancel', type = 'warning' } = props; const getIcon = () => { switch (type) { case 'danger': return ; case 'warning': return ; default: return ; } }; const getConfirmButtonVariant = () => { switch (type) { case 'danger': return 'destructive' as const; default: return 'default' as const; } }; return ( <> {/* Backdrop */} {isOpen && (
)} {/* Modal */}
{/* Header */}
{getIcon()}

{title}

{/* Content */}

{message}

{/* Footer */}
); };