diff --git a/components/Page.tsx b/components/Page.tsx index 91602fc..de548a5 100644 --- a/components/Page.tsx +++ b/components/Page.tsx @@ -7,6 +7,7 @@ import { NationLogo } from '@components/footer/Logos' import Footer from '@components/footer' import TableOfContents from '@components/TableOfContents' import PageSection from '@components/PageSection' +import Unauthorized from '@components/Unauthorized' const renderer: marked.RendererObject = { image(href: string | null): string { @@ -24,34 +25,47 @@ type PageProps = { logos: NationLogo[] navbarLinks: NavbarLink[] isPrivate: boolean + unauthorized?: boolean } -const Page: NextPage = ({ page, navbarLinks, logos, isPrivate }) => { +const Page: NextPage = ({ + page, + navbarLinks, + logos, + isPrivate, + unauthorized = false, +}) => { return (
-

{page?.title}

- {page?.content && ( -
+ {unauthorized ? ( + + ) : ( + <> +

{page?.title}

+ {page?.content && ( +
+ )} + {page?.showTableOfContents && ( + + )} + {page?.sections?.data.map((section, i) => ( + + ))} + )} - {page?.showTableOfContents && ( - - )} - {page?.sections?.data.map((section, i) => ( - - ))}