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
43 lines
986 B
TypeScript
43 lines
986 B
TypeScript
"use client"
|
|
|
|
import { useIntl } from "react-intl"
|
|
|
|
import { dt } from "@scandic-hotels/common/dt"
|
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
|
|
|
import useLang from "@/hooks/useLang"
|
|
|
|
import styles from "./expirationDate.module.css"
|
|
|
|
import type { Dayjs } from "dayjs"
|
|
|
|
export default function ExpirationDate({
|
|
expirationDate,
|
|
}: {
|
|
expirationDate: Dayjs | string
|
|
}) {
|
|
const intl = useIntl()
|
|
const lang = useLang()
|
|
|
|
return (
|
|
<div className={styles.badge}>
|
|
<Typography variant="Body/Supporting text (caption)/smBold">
|
|
<p>
|
|
{intl.formatMessage(
|
|
{
|
|
id: "rewards.expirationDate.validThrough",
|
|
defaultMessage: "Valid through {expirationDate}",
|
|
},
|
|
{
|
|
expirationDate: dt(expirationDate)
|
|
.locale(lang)
|
|
.utc()
|
|
.format("D MMM YYYY"),
|
|
}
|
|
)}
|
|
</p>
|
|
</Typography>
|
|
</div>
|
|
)
|
|
}
|