"use client"; import { Button } from "@/components/ui/button"; import { Trash } from "lucide-react"; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { api } from "@/lib/trpc"; import { useRouter } from "next/navigation"; import { toast } from "@/components/ui/use-toast"; export default function DeleteApiKey({ name, id, }: { name: string; id: string; }) { const router = useRouter(); const deleteKey = async () => { await api.apiKeys.revoke.mutate({ id }); toast({ description: "Key was successfully deleted", }); router.refresh(); }; return ( Delete API Key Are you sure you want to delete the API key "{name}"? Any service using this API key will lose access. ); }