//react import { useState, Fragment, FC } from "react"; //next import { useRouter } from "next/router"; //ui import { Button } from "@plane/ui"; //hooks import useToast from "hooks/use-toast"; //services import { APITokenService } from "services/api_token.service"; //headless ui import { Dialog, Transition } from "@headlessui/react"; type Props = { isOpen: boolean; handleClose: () => void; tokenId?: string; }; const apiTokenService = new APITokenService(); export const DeleteTokenModal: FC = (props) => { const { isOpen, handleClose, tokenId } = props; // states const [deleteLoading, setDeleteLoading] = useState(false); // hooks const { setToastAlert } = useToast(); // router const router = useRouter(); const { workspaceSlug, tokenId: tokenIdFromQuery } = router.query; const handleDeletion = () => { if (!workspaceSlug || (!tokenIdFromQuery && !tokenId)) return; const token = tokenId || tokenIdFromQuery; setDeleteLoading(true); apiTokenService .deleteApiToken(workspaceSlug.toString(), token!.toString()) .then(() => { setToastAlert({ message: "Token deleted successfully", type: "success", title: "Success", }); router.replace(`/${workspaceSlug}/settings/api-tokens/`); }) .catch((err) => { setToastAlert({ message: err?.message, type: "error", title: "Error", }); }) .finally(() => { setDeleteLoading(false); handleClose(); }); }; return (

Are you sure you want to revoke access?

Any applications Using this developer key will no longer have the access to Plane Data. This Action cannot be undone.

); };