import { ImageVaultAsset } from "@scandic-hotels/common/utils/imageVault" import { VariantProps } from "class-variance-authority" import { TeaserCardSidepeekContent } from "../../types/sidepeekContent" import { type ButtonProps } from "../Button" import ButtonLink from "../ButtonLink" import Image from "../Image" import { Typography } from "../Typography" import TeaserCardSidepeek from "./Sidepeek" import styles from "./teaserCard.module.css" import { teaserCardVariants } from "./variants" interface SidePeekButton { call_to_action_text: string } interface TeaserCardButton extends Pick { title: string href: string openInNewTab?: boolean } interface TeaserCardProps extends VariantProps { heading: string bodyText: string primaryButton?: TeaserCardButton secondaryButton?: TeaserCardButton sidePeekButton?: SidePeekButton sidePeekContent?: TeaserCardSidepeekContent image?: ImageVaultAsset className?: string } export function TeaserCard({ heading, bodyText, primaryButton, secondaryButton, sidePeekButton, sidePeekContent, image, style, alwaysStack = false, className, }: TeaserCardProps) { const classNames = teaserCardVariants({ style, alwaysStack, className }) return (
{image && (
{image.meta?.alt
)}

{heading}

{bodyText}

{sidePeekButton && sidePeekContent ? ( ) : (
{primaryButton && ( {primaryButton.title} )} {secondaryButton && ( {secondaryButton.title} )}
)}
) }