Files
web/apps/scandic-web/components/Section/Header/Deprecated.tsx
Bianca Widstam f52d210240 Merged in fix/design-system-remove-preamble (pull request #3153)
remove deprecated preamble, replace with typography

* remove deprecated preamble, replace with typography


Approved-by: Linus Flood
2025-11-13 13:56:22 +00:00

53 lines
1.2 KiB
TypeScript

import Title, { type HeadingProps } from "@scandic-hotels/design-system/Title"
import { Typography } from "@scandic-hotels/design-system/Typography"
import SectionLink from "../Link"
import styles from "./header.module.css"
type HeaderProps = {
link?: {
href: string
text: string
}
preamble?: string | null
textTransform?: HeadingProps["textTransform"]
title?: string | null
headingLevel?: HeadingProps["level"]
headingAs?: HeadingProps["as"]
}
/**
* @deprecated Use `@/components/Section/Header` instead.
*/
export default function SectionHeader({
link,
preamble,
title,
textTransform,
headingAs = "h4",
headingLevel = "h2",
}: HeaderProps) {
if (!title && !preamble && !link) {
return null
}
return (
<header className={styles.header}>
<Title
as={headingAs}
className={styles.title}
level={headingLevel}
textTransform={textTransform}
>
{title}
</Title>
{preamble && (
<Typography variant="Body/Lead text" className={styles.preamble}>
<p>{preamble}</p>
</Typography>
)}
<SectionLink link={link} variant="desktop" />
</header>
)
}