import { type ReactNode } from "react"; import { Button } from "@/client/components/ui/button"; import { Dialog } from "@/client/components/ui/dialog"; type Props = { open: boolean; onClose: () => void; onConfirm: () => void; title: ReactNode; description?: ReactNode; children?: ReactNode; confirmLabel?: string; cancelLabel?: string; destructive?: boolean; loading?: boolean; }; export function ConfirmDialog({ open, onClose, onConfirm, title, description, children, confirmLabel = "Confirm", cancelLabel = "Cancel", destructive = false, loading = false, }: Props) { return ( { if (!loading) onClose(); }} title={title} size="sm" closeOnBackdrop={!loading} footer={ <> } > {description || children ? (
{description ?

{description}

: null} {children}
) : null}
); }