import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import Image from "@scandic-hotels/design-system/Image"
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 { 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 (
{intl.formatMessage({ id: "partnerSas.exchangeFrom", defaultMessage: "Exchange from", })}
{intl.formatMessage({ id: "partnerSas.sasEuroBonus", defaultMessage: "SAS EuroBonus", })}
{intl.formatMessage({ id: "partnerSas.balance", defaultMessage: "Balance", })}
{intl.formatMessage( { id: "partnerSas.pointsWithValue", defaultMessage: "{points, number} p", }, { points: sasPoints } )}
{intl.formatMessage({ id: "partnerSas.noPointsToTransfer", defaultMessage: "You have no points to transfer.", })}
{intl.formatMessage({ id: "partnerSas.exchangeTo", defaultMessage: "Exchange to", })}
{intl.formatMessage({ id: "common.scandicFriends", defaultMessage: "Scandic Friends", })}
{intl.formatMessage({ id: "partnerSas.balance", defaultMessage: "Balance", })}
{intl.formatMessage( { id: "partnerSas.pointsWithValue", defaultMessage: "{points, number} p", }, { points: scandicPoints } )}
{intl.formatMessage({ id: "partnerSas.exchangedPointsNotLevelQualifying", defaultMessage: "Exchanged points will not be level-qualifying.", })}