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 React from "react"; import { toast } from "sonner"; interface Props { sshKeyId: string; } export const DeleteSSHKey = ({ sshKeyId }: Props) => { const { mutateAsync, isLoading } = api.sshKey.remove.useMutation(); const utils = api.useUtils(); return ( Are you absolutely sure? This action cannot be undone. This will permanently delete the SSH key Cancel { await mutateAsync({ sshKeyId, }) .then(() => { utils.sshKey.all.invalidate(); toast.success("SSH Key delete successfully"); }) .catch(() => { toast.error("Error to delete SSH key"); }); }} > Confirm ); };