Files
web/apps/scandic-web/components/Blocks/JoinScandicFriends/index.tsx
Anton Gunnarsson a2213d0169 Merged in feat/sw-3228-move-image-to-design-system (pull request #2616)
feat(SW-3228): Move Image to design-system

* Move Image to design-system

* Merge branch 'master' into feat/sw-3228-move-image-to-design-system


Approved-by: Linus Flood
2025-08-12 12:58:05 +00:00

87 lines
2.6 KiB
TypeScript

import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
import SurpriseIcon from "@scandic-hotels/design-system/Icons/SurpriseIcon"
import Image from "@scandic-hotels/design-system/Image"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { isLoggedInUser } from "@/utils/isLoggedInUser"
import styles from "./joinScandicFriends.module.css"
import type { JoinScandicFriends } from "@/types/trpc/routers/contentstack/startPage"
interface JoinScandicFriendsProps {
content: JoinScandicFriends
}
export default async function JoinScandicFriends({
content,
}: JoinScandicFriendsProps) {
const isLoggedIn = await isLoggedInUser()
if (isLoggedIn) {
return null
}
const { show_header, show_usp, usp, primary_button } = content
return (
<div className={styles.container}>
<div className={styles.iconContainer}>
{content.image ? (
<Image
src={content.image.url}
alt={content.image.title}
width={384}
height={384}
/>
) : (
<SurpriseIcon width="100%" height="100%" />
)}
</div>
<div className={styles.content}>
<div className={styles.textContent}>
{show_header ? (
<header className={styles.header}>
{content.scripted_top_title ? (
<Typography variant="Title/Decorative/md">
<span className={styles.scriptedText}>
{content.scripted_top_title}
</span>
</Typography>
) : null}
<Typography variant="Title/xs">
<h2 className={styles.heading}>{content.title}</h2>
</Typography>
</header>
) : null}
<Typography variant="Body/Paragraph/mdRegular">
<p>{content.preamble}</p>
</Typography>
{show_usp && usp.length ? (
<ul className={styles.usp}>
{usp.map((uspBullet) => (
<Typography key={uspBullet} variant="Body/Paragraph/mdRegular">
<li>{uspBullet}</li>
</Typography>
))}
</ul>
) : null}
</div>
{content.has_primary_button ? (
<ButtonLink
variant="Primary"
size="Small"
href={primary_button.href}
target={primary_button.openInNewTab ? "_blank" : undefined}
typography="Body/Supporting text (caption)/smBold"
className={styles.primaryButton}
>
{primary_button.title}
</ButtonLink>
) : null}
</div>
</div>
)
}