Files
web/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx
Anton Gunnarsson 75a377b59e Merged in chore/sw-3145-move-body (pull request #2505)
chore(SW-3145): Move Body component to design-system

* Move Body component to design-system


Approved-by: Joakim Jäderberg
2025-07-03 08:04:36 +00:00

51 lines
1.3 KiB
TypeScript

"use client"
import { useIntl } from "react-intl"
import Body from "@scandic-hotels/design-system/Body"
import { useBookingConfirmationStore } from "@/stores/booking-confirmation"
import SkeletonShimmer from "@/components/SkeletonShimmer"
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({
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>
)
}