Files
web/apps/scandic-web/components/Blocks/DynamicContent/OverviewTable/LevelSummary/index.tsx
Erik Tiekstra b3c4761ae5 Merged in chore/BOOK-773-replace-old-typography-variables (pull request #3515)
Chore/BOOK-773 replace old typography variables

* chore(BOOK-773): Replaced body typography

* chore(BOOK-773): Replaced caption typography

* chore(BOOK-773): Replaced footnote typography

* chore(BOOK-773): Replaced subtitle typography


Approved-by: Bianca Widstam
2026-02-03 15:07:18 +00:00

46 lines
1.2 KiB
TypeScript

import { useIntl } from "react-intl"
import { Typography } from "@scandic-hotels/design-system/Typography"
import styles from "./levelSummary.module.css"
import type { LevelSummaryProps } from "@/types/components/overviewTable"
export default function LevelSummary({
level,
showDescription = true,
}: LevelSummaryProps) {
const intl = useIntl()
const pointsMsg: React.ReactNode = level.required_nights
? intl.formatMessage(
{
id: "overviewTable.levelSummary.pointsOrNights",
defaultMessage:
"{pointsAmount, number} points or {nightsAmount, number} nights",
},
{
pointsAmount: level.required_points,
nightsAmount: level.required_nights,
}
)
: intl.formatMessage(
{
id: "common.pointsAmountPoints",
defaultMessage: "{pointsAmount, number} points",
},
{ pointsAmount: level.required_points }
)
return (
<div className={styles.levelSummary}>
<Typography variant="Label/xsRegular">
<span className={styles.levelRequirements}>{pointsMsg}</span>
</Typography>
{showDescription && (
<p className={styles.levelSummaryText}>{level.description}</p>
)}
</div>
)
}