fix: always use totalPrice to display roomCharge

This commit is contained in:
Simon Emanuelsson
2025-04-16 12:41:37 +02:00
parent 1f94c581ae
commit 722d4505ba
18 changed files with 312 additions and 864 deletions

View File

@@ -0,0 +1,40 @@
"use client"
import { useIntl } from "react-intl"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { useMyStayTotalPriceStore } from "@/stores/my-stay/myStayTotalPrice"
import SkeletonShimmer from "@/components/SkeletonShimmer"
import { formatPrice } from "@/utils/numberFormatting"
import { CurrencyEnum } from "@/types/enums/currency"
export default function Cheques({
cheques,
price,
}: {
cheques: number
price: number
}) {
const intl = useIntl()
const currencyCode = useMyStayTotalPriceStore((state) => state.currencyCode)
if (!cheques) {
return <SkeletonShimmer width={"100px"} />
}
const totalPrice = formatPrice(
intl,
cheques,
CurrencyEnum.CC,
price,
currencyCode
)
return (
<Typography variant="Title/Subtitle/lg">
<p>{totalPrice}</p>
</Typography>
)
}