Files
web/apps/scandic-web/components/TempDesignSystem/TeaserCard/index.tsx
Bianca Widstam 1b9273136a Merged in chore/BOOK-701-replace-subtitle-component (pull request #3398)
chore(BOOK-701): replace subtitle with typography

* chore(BOOK-701): replace subtitle with typography

* chore(BOOK-701): align center

* chore(BOOK-701): change token

* chore(BOOK-701): change text color

* fix(BOOK-704): revert pricechange dialog changes

* chore(BOOK-701): remove subtitle from package.json


Approved-by: Matilda Landström
2026-01-12 07:40:30 +00:00

85 lines
2.4 KiB
TypeScript

import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
import Image from "@scandic-hotels/design-system/Image"
import { Typography } from "@scandic-hotels/design-system/Typography"
import TeaserCardSidepeek from "./Sidepeek"
import { teaserCardVariants } from "./variants"
import styles from "./teaserCard.module.css"
import type { TeaserCardProps } from "@/types/components/teaserCard"
export default function TeaserCard({
title,
description,
primaryButton,
secondaryButton,
sidePeekButton,
sidePeekContent,
image,
intent,
alwaysStack = false,
className,
}: TeaserCardProps) {
const classNames = teaserCardVariants({ intent, alwaysStack, className })
return (
<article className={classNames}>
{image && (
<div className={styles.imageContainer}>
<Image
src={image.url}
alt={image.meta?.alt || ""}
className={styles.image}
focalPoint={image.focalPoint}
dimensions={image.dimensions}
fill
/>
</div>
)}
<div className={styles.content}>
<Typography variant="Title/Subtitle/md">
<p>{title}</p>
</Typography>
<Typography variant="Body/Paragraph/mdRegular">
<p>{description}</p>
</Typography>
{sidePeekButton && sidePeekContent ? (
<TeaserCardSidepeek
button={sidePeekButton}
sidePeekContent={sidePeekContent}
/>
) : (
<div className={styles.ctaContainer}>
{primaryButton && (
<ButtonLink
variant="Tertiary"
color="Primary"
size="sm"
className={styles.ctaButton}
href={primaryButton.href}
target={primaryButton.openInNewTab ? "_blank" : undefined}
>
{primaryButton.title}
</ButtonLink>
)}
{secondaryButton && (
<ButtonLink
variant="Secondary"
color="Primary"
size="sm"
className={styles.ctaButton}
href={secondaryButton.href}
target={secondaryButton.openInNewTab ? "_blank" : undefined}
>
{secondaryButton.title}
</ButtonLink>
)}
</div>
)}
</div>
</article>
)
}