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 (
{intl.formatMessage({ id: "Transfer from" })}
{intl.formatMessage({ id: "SAS EuroBonus" })}
{intl.formatMessage({ id: "Balance" })}
{intl.formatMessage( { id: "{points, number} p" }, { points: sasPoints } )}
{intl.formatMessage({ id: "You have no points to transfer.", })}
{intl.formatMessage({ id: "Transfer to" })}
{intl.formatMessage({ id: "Scandic Friends" })}
{intl.formatMessage({ id: "Balance" })}
{intl.formatMessage( { id: "{points, number} p" }, { points: scandicPoints } )}
{intl.formatMessage({ id: "Transferred points will not be level qualifying", })}