Files
web/components/Blocks/DynamicContent/SectionWrapper/index.tsx
Joakim Jäderberg 3d11cfb50a Merged in feature/sas-mypages (pull request #1302)
Feature/sas mypages

* feat: Add SAS partner page under my pages
* fix: feature toggle SAS Partner page in my pages
* add translations for SAS account page
* use 'flex-start' instead of 'start'
* fix: flatten css
* fix: don't use <SectionContainer /> on linkedAccounts page
2025-02-11 12:55:00 +00:00

35 lines
1002 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}
headingAs={firstItem ? "h3" : "h4"}
headingLevel={firstItem ? "h1" : "h2"}
/>
) : null}
{children}
{dynamic_content.link ? (
<SectionLink link={dynamic_content.link} variant="mobile" />
) : null}
</SectionContainer>
)
}