import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import { Typography } from "@scandic-hotels/design-system/Typography" import { getProfileWithExtendedPartnerData } from "@/lib/trpc/memoizedRequests" import Image from "@/components/Image" import SkeletonShimmer from "@/components/SkeletonShimmer" import { getIntl } from "@/i18n" import { getEurobonusMembership } from "@/utils/user" import { TransferPointsFormClient } from "./TransferPointsFormClient" import styles from "./transferPoints.module.css" import type { Lang } from "@/constants/languages" export async function TransferPointsForm({ lang }: { lang: Lang }) { const profile = await getProfileWithExtendedPartnerData() if (!profile) return null const eurobonusMembership = getEurobonusMembership(profile?.loyalty) if (!eurobonusMembership) return null const scandicPoints = profile?.membership?.currentPoints ?? 0 const sasPoints = eurobonusMembership.spendablePoints || 0 // TODO get from api const exchangeRate = 2 return ( ) } export async function TransferPointsFormSkeleton({ lang }: { lang: Lang }) { return ( ) } async function TransferPointsFormContent({ sasPoints, scandicPoints, exchangeRate, lang, }: { sasPoints: number | null scandicPoints: number | null exchangeRate: number | null lang: Lang }) { const intl = await getIntl() return (

{intl.formatMessage({ id: "Transfer from" })}

{intl.formatMessage({ id: "SAS EuroBonus" })}

{intl.formatMessage({ id: "Balance" })}

{sasPoints === null ? ( ) : (

{intl.formatMessage( { id: "{points, number} p" }, { points: sasPoints } )}

)}
{sasPoints === 0 && (

{intl.formatMessage({ id: "You have no points to transfer.", })}

)}

{intl.formatMessage({ id: "Transfer to" })}

{intl.formatMessage({ id: "Scandic Friends" })}

{intl.formatMessage({ id: "Balance" })}

{scandicPoints === null ? ( ) : (

{intl.formatMessage( { id: "{points, number} p" }, { points: scandicPoints } )}

)}

{intl.formatMessage({ id: "Transferred points will not be level qualifying", })}

) }