import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "~/components/ui/alert-dialog" import { cn } from "~/lib/utils" import { dialogPrimaryButtonClass, dialogSecondaryButtonClass, } from "./AppFormDialog" import { dangerSolidButtonClass } from "./buttonClasses" type ConfirmDialogProps = { open: boolean onOpenChange: (open: boolean) => void title: string description: string confirmLabel?: string cancelLabel?: string destructive?: boolean onConfirm: () => void | Promise } function ConfirmDialog({ open, onOpenChange, title, description, confirmLabel = "确定", cancelLabel = "取消", destructive = false, onConfirm, }: ConfirmDialogProps) { return ( {title} {description} {cancelLabel} void onConfirm()} > {confirmLabel} ) } export { ConfirmDialog }