From d6dd76021226802adf5295b3243d6f2ae4fa5cc2 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sun, 10 Mar 2024 17:59:58 +0000 Subject: refactor: Move all components to the top level directory --- .../dashboard/settings/components/DeleteApiKey.tsx | 74 ---------------------- 1 file changed, 74 deletions(-) delete mode 100644 packages/web/app/dashboard/settings/components/DeleteApiKey.tsx (limited to 'packages/web/app/dashboard/settings/components/DeleteApiKey.tsx') diff --git a/packages/web/app/dashboard/settings/components/DeleteApiKey.tsx b/packages/web/app/dashboard/settings/components/DeleteApiKey.tsx deleted file mode 100644 index 566136af..00000000 --- a/packages/web/app/dashboard/settings/components/DeleteApiKey.tsx +++ /dev/null @@ -1,74 +0,0 @@ -"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 { useRouter } from "next/navigation"; -import { toast } from "@/components/ui/use-toast"; -import { api } from "@/lib/trpc"; -import { ActionButton } from "@/components/ui/action-button"; -import { useState } from "react"; - -export default function DeleteApiKey({ - name, - id, -}: { - name: string; - id: string; -}) { - const [isDialogOpen, setDialogOpen] = useState(false); - const router = useRouter(); - const mutator = api.apiKeys.revoke.useMutation({ - onSuccess: () => { - toast({ - description: "Key was successfully deleted", - }); - setDialogOpen(false); - 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. - - - - - - - mutator.mutate({ id })} - > - Delete - - - - - ); -} -- cgit v1.2.3-70-g09d2