-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpresentations.tsx
More file actions
47 lines (35 loc) · 988 Bytes
/
presentations.tsx
File metadata and controls
47 lines (35 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import type { GetServerSideProps, NextPage } from "next";
import Head from "next/head";
import type { PageData } from "@/helpers/types";
import getPageContent from "@/helpers/getPageContent";
import { setPageCacheHeaders } from "@/helpers/setHeaders";
import CommonPage from "@/layout/CommonPage";
interface PageProps {
data: PageData;
}
const pageSitemap = {
title: "Presentations",
path: "/presentations",
};
const Page: NextPage<PageProps> = ({ data }) => (
<>
<Head>
<meta name="robots" content="noindex,nofollow" />
</Head>
<CommonPage page={pageSitemap} breadcrumbs={[pageSitemap]} data={data} />
</>
);
export const getServerSideProps: GetServerSideProps<PageProps> = async (ctx) => {
const preview = ctx?.query.preview === "true";
const data = await getPageContent("/presentations", { preview });
if (!preview) {
setPageCacheHeaders(ctx);
}
return {
props: {
preview,
data,
},
};
};
export default Page;