import React from 'react'; import { Dialog, DialogHeader, DialogTitle, DialogDescription, DialogContent, DialogFooter, DialogClose, } from './Dialog'; import Button from './Button'; import { AlertTriangle } from 'lucide-react'; export interface ConfirmDialogProps { open: boolean; onOpenChange: (open: boolean) => void; onConfirm: () => void; title: string; description?: string; confirmLabel?: string; cancelLabel?: string; variant?: 'default' | 'destructive'; icon?: React.ReactNode; } /** * Confirmation dialog component */ export const ConfirmDialog = ({ open, onOpenChange, onConfirm, title, description, confirmLabel = 'Confirm', cancelLabel = 'Cancel', variant = 'default', icon, }: ConfirmDialogProps) => { const handleConfirm = () => { onConfirm(); onOpenChange(false); }; const displayIcon = icon || (variant === 'destructive' ? : null); return (
{displayIcon &&
{displayIcon}
} {title}
{description && {description}}
{/* Content can be customized if needed */} onOpenChange(false)} />
); };