Files
web/apps/scandic-web/components/Blocks/DynamicContent/SectionWrapper/index.tsx
Erik Tiekstra 689e9d72cb fix(SW-1886): Removed "firstItem" props from blocks as it generates multiple h1 tags on those pages
* feat(SW-1886): Removed "firstItem" props from blocks as it generates multiple h1 tags on those pages


Approved-by: Fredrik Thorsson
Approved-by: Simon.Emanuelsson
2025-03-12 14:09:20 +00:00

34 lines
947 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,
}: 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}
headingAs="h3"
headingLevel="h2"
/>
) : null}
{children}
{dynamic_content.link ? (
<SectionLink link={dynamic_content.link} variant="mobile" />
) : null}
</SectionContainer>
)
}