import { Button } from "@repo/shadcn-ui/components/button"; import { useState } from "react"; import { FormActions, FormBody, FormDialog } from "./form-dialog"; export function ConfirmDeleteDialog({ open, onOpenChange, title, description, cancelLabel, confirmLabel, pendingLabel, errorLabel, onConfirm, }: { open: boolean; onOpenChange: (open: boolean) => void; title: string; description: string; cancelLabel: string; confirmLabel: string; pendingLabel: string; errorLabel: string; onConfirm: () => Promise; }) { const [pending, setPending] = useState(false); const [failed, setFailed] = useState(false); return ( { if (!pending) { setFailed(false); onOpenChange(value); } }} open={open} title={title} >

{description}

{failed && (

{errorLabel}

)}
); }