import { Dialog, DialogContent, DialogTitle, DialogDescription, } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; interface Props { open: boolean; onConfirm: () => void; onCancel: () => void; title?: string; description?: string; confirmText?: string; cancelText?: string; variant?: 'danger' | 'default'; } export function ConfirmDialog({ open, onConfirm, onCancel, title = '确认操作', description, confirmText = '确认', cancelText = '取消', variant = 'default', }: Props) { return ( { if (!v) onCancel(); }}> e.preventDefault()} onInteractOutside={(e) => e.preventDefault()} > {title} {description && ( {description} )}
); }