-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathSiteContentLayout.tsx
37 lines (35 loc) · 1021 Bytes
/
SiteContentLayout.tsx
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
import { GitBookSiteSpaceContext } from '@v2/lib/context';
import { Footer } from '@/components/Footer';
/**
* Layout component to render the site content.
*/
export async function SiteContentLayout({
context,
children,
}: {
context: GitBookSiteSpaceContext;
children: React.ReactNode;
}) {
const [publishedSite, space] = await Promise.all([
context.getPublishedContentSite(
context.organizationId,
context.siteId,
),
context.getSpaceById(context.spaceId, context.siteShareKey),
]);
return (
<html lang="en">
<body>
<h1>{publishedSite.site.title}</h1>
{children}
<Footer
space={space}
customization={
publishedSite.customizations.siteSpaces[context.siteSpaceId] ??
publishedSite.customizations.site
}
/>
</body>
</html>
);
}