Files
web/apps/scandic-web/components/Blocks/DynamicContent/Overview/MembershipOverviewCard/SasBoostStatus.tsx
Chuma Mcphoy (We Ahead) 0737f4fb78 Merged in feat/LOY-354-L7-Progress-Card (pull request #2786)
Feat/LOY-354 L7 Progress Card

* feat(LOY-354): Add Trophy icon

* fix(LOY-354): include new tierPoints value

* feat(LOY-354): L7 Progress Level Card support

* refactor(LOY-354): Refactoring of component structure

* fix(LOY-354): Remove intl prop drilling

* fix(LOY-354): cleanup progress section code


Approved-by: Erik Tiekstra
2025-09-15 11:48:18 +00:00

47 lines
1.2 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 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()
if (!sasMembership.boostedTierExpires || sasMembership.boostedByScandic) {
return null
}
const sasBoostExpiryText = intl.formatMessage(
{
defaultMessage: "Boosted by SAS until {date}",
},
{
date: dt(sasMembership.boostedTierExpires)
.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>
</>
)
}