Files
web/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx
Hrishikesh Vaipurkar 8e00769c64 Merged in chore/SW-3395-move-bookingconfirmationprovider (pull request #2757)
chore(SW-3395): Moved BookingConfirmationProvider to booking-flow package

* chore(SW-3395): Moved BookingConfirmationProvider to booking-flow package


Approved-by: Anton Gunnarsson
2025-09-04 08:14:50 +00:00

49 lines
1.3 KiB
TypeScript

"use client"
import { useIntl } from "react-intl"
import { useBookingConfirmationStore } from "@scandic-hotels/booking-flow/stores/booking-confirmation"
import Body from "@scandic-hotels/design-system/Body"
import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer"
import Subtitle from "@scandic-hotels/design-system/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({
defaultMessage: "Payment details",
})}
</Subtitle>
<div className={styles.payment}>
{hasAllRoomsLoaded ? (
<Body color="uiTextHighContrast">
{intl.formatMessage(
{
defaultMessage: "Total cost: {amount}",
},
{
amount: formattedTotalCost,
}
)}
</Body>
) : (
<SkeletonShimmer width={"100%"} />
)}
</div>
</div>
)
}