Files
web/apps/scandic-web/components/TempDesignSystem/LoyaltyCard/index.tsx
Anton Gunnarsson 923206ee4c Merged in chore/sw-3145-move-subtitle (pull request #2516)
chore(SW-3145): Move Title and Subtitle to design-system

* Move Title and Subtitle to design-system

* Fix export


Approved-by: Linus Flood
2025-07-04 06:22:28 +00:00

64 lines
1.6 KiB
TypeScript

import Body from "@scandic-hotels/design-system/Body"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import Title from "@scandic-hotels/design-system/Title"
import Image from "@/components/Image"
import Link from "@/components/TempDesignSystem/Link"
import { loyaltyCardVariants } from "./variants"
import styles from "./loyaltyCard.module.css"
import type { LoyaltyCardProps } from "./loyaltyCard"
export default function LoyaltyCard({
link,
image,
heading,
bodyText,
theme = "white",
className,
}: LoyaltyCardProps) {
return (
<article
className={loyaltyCardVariants({
className,
theme,
})}
>
{image ? (
<Image
src={image.url}
width={180}
height={160}
className={styles.image}
alt={image.meta.alt || image.title}
focalPoint={image.focalPoint}
/>
) : null}
<Title as="h4" level="h3" textAlign="center">
{heading}
</Title>
{bodyText ? <Body textAlign="center">{bodyText}</Body> : null}
<div className={styles.buttonContainer}>
{link ? (
<Link
className={styles.link}
href={link.href}
target={link.openInNewTab ? "_blank" : undefined}
textDecoration="underline"
>
<MaterialIcon
icon="arrow_right"
color="CurrentColor"
className={styles.icon}
size={20}
/>
{link.title}
</Link>
) : null}
</div>
</article>
)
}