"use client" import { useIntl } from "react-intl" import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer" import { Typography } from "@scandic-hotels/design-system/Typography" import { useBookingConfirmationStore } from "../../../stores/booking-confirmation" import styles from "./paymentDetails.module.css" export function PaymentDetails() { const intl = useIntl() const { rooms, formattedTotalCost } = useBookingConfirmationStore( (state) => ({ rooms: state.rooms, formattedTotalCost: state.formattedTotalCost, }) ) const hasAllRoomsLoaded = rooms.every((room) => room) return (

{intl.formatMessage({ id: "bookingConfirmation.paymentDetails", defaultMessage: "Payment details", })}

{hasAllRoomsLoaded ? (

{intl.formatMessage( { id: "bookingConfirmation.totalCost", defaultMessage: "Total cost: {amount}", }, { amount: formattedTotalCost, } )}

) : ( )}
) }