Files
web/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx
Anton Gunnarsson 923206ee4c Merged in chore/sw-3145-move-subtitle (pull request #2516)
chore(SW-3145): Move Title and Subtitle to design-system

* Move Title and Subtitle to design-system

* Fix export


Approved-by: Linus Flood
2025-07-04 06:22:28 +00:00

50 lines
1.3 KiB
TypeScript

"use client"
import { useIntl } from "react-intl"
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 { useBookingConfirmationStore } from "@/stores/booking-confirmation"
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>
)
}