feat(SW-353): dynamic rewards

This commit is contained in:
Christel Westerberg
2024-09-25 15:59:16 +02:00
parent 6a85cfd19c
commit 56cd02f90b
78 changed files with 1568 additions and 4587 deletions

View File

@@ -1,3 +1,7 @@
import { useIntl } from "react-intl"
import useLang from "@/hooks/useLang"
import styles from "./levelSummary.module.css"
import type { LevelSummaryProps } from "@/types/components/overviewTable"
@@ -6,9 +10,17 @@ export default function LevelSummary({
level,
showDescription = true,
}: LevelSummaryProps) {
const lang = useLang()
const intl = useIntl()
return (
<div className={styles.levelSummary}>
<span className={styles.levelRequirements}>{level.requirement}</span>
<span className={styles.levelRequirements}>
{level.required_points.toLocaleString(lang)}
{"p "}
{level.required_nights
? `${intl.formatMessage({ id: "or" })} ${level.required_nights} ${intl.formatMessage({ id: "nights" })}`
: ""}
</span>
{showDescription && (
<p className={styles.levelSummaryText}>{level.description}</p>
)}