plane/web/pages/[workspaceSlug]/settings/api-tokens/create.tsx
sriram veeraghanta 2481706581
chore: optimizations and file name changes (#2845)
* fix: deepsource antipatterns

* fix: deepsource exclude file patterns

* chore: file name changes and removed unwanted variables

* fix: changing version number for editor
2023-11-23 15:09:46 +05:30

37 lines
1.2 KiB
TypeScript

import { useState } from "react";
import { NextPage } from "next";
// layouts
import { AppLayout } from "layouts/app-layout/layout";
import { WorkspaceSettingLayout } from "layouts/settings-layout";
//types
import { IApiToken } from "types/api_token";
//Mobx
import { observer } from "mobx-react-lite";
// components
import { WorkspaceSettingHeader } from "components/headers";
import { APITokenForm, DeleteTokenModal } from "components/api-token";
const CreateApiToken: NextPage = () => {
const [generatedToken, setGeneratedToken] = useState<IApiToken | null>();
const [deleteTokenModal, setDeleteTokenModal] = useState<boolean>(false);
return (
<AppLayout header={<WorkspaceSettingHeader title="Api Tokens" />}>
<WorkspaceSettingLayout>
<DeleteTokenModal
isOpen={deleteTokenModal}
handleClose={() => setDeleteTokenModal(false)}
tokenId={generatedToken?.id}
/>
<APITokenForm
generatedToken={generatedToken}
setGeneratedToken={setGeneratedToken}
setDeleteTokenModal={setDeleteTokenModal}
/>
</WorkspaceSettingLayout>
</AppLayout>
);
};
export default observer(CreateApiToken);