34 lines
938 B
TypeScript
34 lines
938 B
TypeScript
import SectionContainer from "@/components/Section/Container"
|
|
import SectionHeader from "@/components/Section/Header"
|
|
import SectionLink from "@/components/Section/Link"
|
|
|
|
import type { DynamicContentProps } from "@/types/components/blocks/dynamicContent"
|
|
|
|
export default function SectionWrapper({
|
|
children,
|
|
dynamic_content,
|
|
firstItem,
|
|
}: React.PropsWithChildren<DynamicContentProps>) {
|
|
const displayHeader = !!(
|
|
dynamic_content.link ||
|
|
dynamic_content.subtitle ||
|
|
dynamic_content.title
|
|
)
|
|
return (
|
|
<SectionContainer>
|
|
{displayHeader ? (
|
|
<SectionHeader
|
|
link={dynamic_content.link}
|
|
preamble={dynamic_content.subtitle}
|
|
title={dynamic_content.title}
|
|
topTitle={firstItem}
|
|
/>
|
|
) : null}
|
|
{children}
|
|
{dynamic_content.link ? (
|
|
<SectionLink link={dynamic_content.link} variant="mobile" />
|
|
) : null}
|
|
</SectionContainer>
|
|
)
|
|
}
|