import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; import { TrashIcon } from "lucide-react"; import { toast } from "sonner"; interface Props { backupId: string; refetch: () => void; } export const DeleteBackup = ({ backupId, refetch }: Props) => { const { mutateAsync, isLoading } = api.backup.remove.useMutation(); return ( Are you absolutely sure? This action cannot be undone. This will permanently delete the backup Cancel { await mutateAsync({ backupId, }) .then(() => { refetch(); toast.success("Backup delete succesfully"); }) .catch(() => { toast.error("Error to delete the backup"); }); }} > Confirm ); };