Feat/lokalise rebuild * chore(lokalise): update translation ids * chore(lokalise): easier to switch between projects * chore(lokalise): update translation ids * . * . * . * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * chore(lokalise): new translations * merge * switch to errors for missing id's * merge * sync translations Approved-by: Linus Flood
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import { dt } from "@scandic-hotels/common/dt"
|
|
import { Divider } from "@scandic-hotels/design-system/Divider"
|
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
|
|
|
import { getLang } from "@/i18n/serverContext"
|
|
import { getSasTierExpirationDate } from "@/utils/sas"
|
|
|
|
import styles from "./membershipOverviewCard.module.css"
|
|
|
|
import type { EurobonusMembership } from "@scandic-hotels/trpc/types/user"
|
|
import type { IntlShape } from "react-intl"
|
|
|
|
interface SasBoostStatusProps {
|
|
sasMembership: EurobonusMembership
|
|
intl: IntlShape
|
|
}
|
|
|
|
export default async function SasBoostStatus({
|
|
sasMembership,
|
|
intl,
|
|
}: SasBoostStatusProps) {
|
|
const lang = await getLang()
|
|
const tierExpirationDate = getSasTierExpirationDate(sasMembership)
|
|
|
|
if (!tierExpirationDate || sasMembership.boostedByScandic) {
|
|
return null
|
|
}
|
|
|
|
const sasBoostExpiryText = intl.formatMessage(
|
|
{
|
|
id: "membershipOverViewCard.sasBoostedUntilDate",
|
|
defaultMessage: "Boosted by SAS until {date}",
|
|
},
|
|
{
|
|
date: dt(tierExpirationDate).locale(lang).format("D MMM YYYY"),
|
|
}
|
|
)
|
|
|
|
return (
|
|
<>
|
|
<Divider variant="vertical" color="Border/Divider/Accent" />
|
|
<Typography variant="Label/xsRegular">
|
|
<span className={styles.sasBoostText}>{sasBoostExpiryText}</span>
|
|
</Typography>
|
|
</>
|
|
)
|
|
}
|