LegalTemplate.tsx32 lines · main
1import type { LegalPage } from '../schemas'
2import HeroSection from '../sections/HeroSection'
3import SectionRenderer, { type CustomSectionRenderers } from '../sections/SectionRenderer'
4import TableOfContents from '../sections/TableOfContents'
5import TextBodySection from '../sections/TextBodySection'
6
7export default function LegalTemplate({
8 page,
9 customRenderers,
10}: {
11 page: LegalPage
12 customRenderers?: CustomSectionRenderers
13}) {
14 const hero = page.effectiveDate
15 ? { ...page.hero, subtitle: `Effective date: ${page.effectiveDate}` }
16 : page.hero
17
18 return (
19 <div className="flex flex-col gap-16 sm:gap-24">
20 <HeroSection section={hero} compact />
21 <div className="grid grid-cols-1 lg:grid-cols-[220px_1fr] gap-24 max-w-5xl mx-auto px-8 w-full">
22 <div className="hidden lg:block">
23 <TableOfContents content={page.body} />
24 </div>
25 <TextBodySection section={{ content: page.body }} />
26 </div>
27 {page.sections?.map((section, i) => (
28 <SectionRenderer key={i} section={section} customRenderers={customRenderers} />
29 ))}
30 </div>
31 )
32}