import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer" import { Typography } from "@scandic-hotels/design-system/Typography" import { getEurobonusMembership } from "@scandic-hotels/trpc/routers/user/helpers" import { getProfileWithExtendedPartnerData } from "@/lib/trpc/memoizedRequests" import Image from "@/components/Image" import { getIntl } from "@/i18n" import { TransferPointsFormClient } from "./TransferPointsFormClient" import styles from "./transferPoints.module.css" import type { Lang } from "@scandic-hotels/common/constants/language" export async function TransferPointsForm({ lang }: { lang: Lang }) { const profile = await getProfileWithExtendedPartnerData() if (!profile || !profile.loyalty) 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({ defaultMessage: "Transfer from", })}

{intl.formatMessage({ defaultMessage: "SAS EuroBonus", })}

{intl.formatMessage({ defaultMessage: "Balance", })}

{sasPoints === null ? ( ) : (

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

)}
{sasPoints === 0 && (

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

)}

{intl.formatMessage({ defaultMessage: "Transfer to", })}

{intl.formatMessage({ defaultMessage: "Scandic Friends", })}

{intl.formatMessage({ defaultMessage: "Balance", })}

{scandicPoints === null ? ( ) : (

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

)}

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

) }