feat: SW-2079 Show points in confirmation page * feat: SW-2079 Show points in confirmation page * feat: SW-2079 Optimized code * feat: SW-2079 Updated Body to Typography * feat: SW-2079 Multi-room total cost display * feat: SW-2079 Add reward nights condition rate title * feat: SW-2079 Removed extra checks * feat: SW-2079 Optimmized formatPrice function * feat: SW-2079 Typo fix Approved-by: Christian Andolf
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
"use client"
|
|
|
|
import { useIntl } from "react-intl"
|
|
|
|
import { useBookingConfirmationStore } from "@/stores/booking-confirmation"
|
|
|
|
import SkeletonShimmer from "@/components/SkeletonShimmer"
|
|
import Body from "@/components/TempDesignSystem/Text/Body"
|
|
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
|
|
|
import styles from "./paymentDetails.module.css"
|
|
|
|
export default function PaymentDetails() {
|
|
const intl = useIntl()
|
|
|
|
const { rooms, formattedTotalCost } = useBookingConfirmationStore(
|
|
(state) => ({
|
|
rooms: state.rooms,
|
|
formattedTotalCost: state.formattedTotalCost,
|
|
})
|
|
)
|
|
|
|
const hasAllRoomsLoaded = rooms.every((room) => room)
|
|
return (
|
|
<div className={styles.details}>
|
|
<Subtitle color="uiTextHighContrast" type="two">
|
|
{intl.formatMessage({ id: "Payment details" })}
|
|
</Subtitle>
|
|
<div className={styles.payment}>
|
|
{hasAllRoomsLoaded ? (
|
|
<Body color="uiTextHighContrast">
|
|
{intl.formatMessage(
|
|
{ id: "Total cost: {amount}" },
|
|
{
|
|
amount: formattedTotalCost,
|
|
}
|
|
)}
|
|
</Body>
|
|
) : (
|
|
<SkeletonShimmer width={"100%"} />
|
|
)}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|