import React from "react"; import { useRouter } from "next/router"; import useSWR from "swr"; // lib import { requiredWorkspaceAdmin } from "lib/auth"; // services import workspaceService from "services/workspace.service"; // layouts import AppLayout from "layouts/app-layout"; // ui import { Button } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; // types import type { NextPage, GetServerSideProps } from "next"; // fetch-keys import { WORKSPACE_DETAILS } from "constants/fetch-keys"; type TBillingSettingsProps = { isOwner: boolean; isMember: boolean; isViewer: boolean; isGuest: boolean; }; const BillingSettings: NextPage = (props) => { const { query: { workspaceSlug }, } = useRouter(); const { data: activeWorkspace } = useSWR( workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, () => (workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null) ); return ( <> } >

Billing & Plans

[Free launch preview] plan Pro

Payment due

--

Current plan

You are currently using the free plan

Billing history

There are no invoices to display

); }; export const getServerSideProps: GetServerSideProps = async (ctx) => { const workspaceSlug = ctx.params?.workspaceSlug as string; const memberDetail = await requiredWorkspaceAdmin(workspaceSlug, ctx.req.headers.cookie); if (memberDetail === null) { return { redirect: { destination: "/", permanent: false, }, }; } return { props: { isOwner: memberDetail?.role === 20, isMember: memberDetail?.role === 15, isViewer: memberDetail?.role === 10, isGuest: memberDetail?.role === 5, }, }; }; export default BillingSettings;