feat: translate Voucher everywhere during booking flow

This commit is contained in:
Simon Emanuelsson
2025-06-27 15:03:24 +02:00
committed by Simon.Emanuelsson
parent a0b0ed2544
commit 59f4a27cb1
10 changed files with 71 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
import { cx } from "class-variance-authority"
import { useIntl } from "react-intl"
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { formatPrice } from "@/utils/numberFormatting"
@@ -21,10 +22,14 @@ export default function LargeRow({
price,
}: RowProps) {
const intl = useIntl()
const isVoucherRate = price.local.currency === CurrencyEnum.Voucher
const currency = isVoucherRate
? intl.formatMessage({ defaultMessage: "Voucher" })
: price.local.currency
const totalPrice = formatPrice(
intl,
price.local.price,
price.local.currency,
currency,
price.local.additionalPrice,
price.local.additionalPriceCurrency
)