Files
web/packages/booking-flow/lib/components/BookingConfirmation/PaymentDetails/index.tsx
Anton Gunnarsson 914da2b094 Merged in chore/apply-lint-fix (pull request #3312)
chore: Apply lint:fix on booking-flow

* run lint:fix


Approved-by: Bianca Widstam
2025-12-08 13:50:41 +00:00

55 lines
1.4 KiB
TypeScript

"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 (
<div className={styles.details}>
<Typography variant="Title/Subtitle/md">
<h2>
{intl.formatMessage({
id: "bookingConfirmation.paymentDetails",
defaultMessage: "Payment details",
})}
</h2>
</Typography>
<div className={styles.payment}>
{hasAllRoomsLoaded ? (
<Typography variant="Body/Paragraph/mdRegular">
<p>
{intl.formatMessage(
{
id: "bookingConfirmation.totalCost",
defaultMessage: "Total cost: {amount}",
},
{
amount: formattedTotalCost,
}
)}
</p>
</Typography>
) : (
<SkeletonShimmer width="100%" />
)}
</div>
</div>
)
}