// react import React from "react"; // next import type { NextPage } from "next"; import { useRouter } from "next/router"; // layouts import { AppLayout } from "layouts/app-layout"; import { WorkspaceSettingLayout } from "layouts/settings-layout"; // component import { WorkspaceSettingHeader } from "components/headers"; import ApiTokenEmptyState from "components/api-token/empty-state"; // ui import { Spinner, Button } from "@plane/ui"; // services import { ApiTokenService } from "services/api_token.service"; // constants import { API_TOKENS_LIST } from "constants/fetch-keys"; // swr import useSWR from "swr"; import { ApiTokenListItem } from "components/api-token/ApiTokenListItem"; const apiTokenService = new ApiTokenService(); const Api: NextPage = () => { const router = useRouter(); const { workspaceSlug } = router.query; const { data: tokens, isLoading } = useSWR(workspaceSlug ? API_TOKENS_LIST(workspaceSlug.toString()) : null, () => workspaceSlug ? apiTokenService.getApiTokens(workspaceSlug.toString()) : null ); return ( }> {!isLoading ? ( tokens && tokens.length > 0 ? (

Api Tokens

{tokens?.map((token) => ( ))}
) : (
) ) : (
)}
); }; export default Api;