/** * Reusable confirmation dialog component */ import React from 'react'; export interface ConfirmDialogProps { isOpen: boolean; onClose: () => void; onConfirm?: () => void; title: string; message: React.ReactNode; subMessage?: React.ReactNode; confirmText?: string; cancelText?: string; variant?: 'info' | 'warning'; showCancel?: boolean; wide?: boolean; } export const ConfirmDialog: React.FC = ({ isOpen, onClose, onConfirm, title, message, subMessage, confirmText = 'Got it', cancelText = 'Cancel', variant = 'info', showCancel = false, wide = false, }) => { if (!isOpen) return null; const iconColors = { info: 'bg-accent/20 text-accent', warning: 'bg-warning/20 text-warning', }; const buttonColors = { info: 'bg-primary text-primary-foreground hover:opacity-90', warning: 'bg-warning text-warning-foreground hover:opacity-90', }; const icons = { info: ( ), warning: ( ), }; return (
{icons[variant]}

{title}

{message}
{subMessage && (
{subMessage}
)} {!subMessage &&
}
{showCancel && ( )}
); };