Files
web/apps/scandic-web/components/HotelReservation/MyStay/Rooms/MultiRoom/index.tsx
Simon.Emanuelsson 85acd3453d Merged in feat/SW-1719-strikethrough-rates (pull request #2266)
Feat/SW-1719 strikethrough rates

* feat(SW-1719): Strikethrough rate if logged in on regular rate cards

* feat(SW-1719): Strikethrough rate if logged in on rate summary

* feat(SW-1719): Strikethrough rate if logged in on mobile rate summary

* feat(SW-1719): Strikethrough rate if logged in on enter details

* feat(SW-1719): Strikethrough rate support for multiple rooms

* feat(SW-1719): booking receipt fixes on confirmation page

* feat(SW-1719): improve initial total price calculation

* feat: harmonize enter details total price to use one and the same function


Approved-by: Michael Zetterberg
2025-06-13 12:01:16 +00:00

71 lines
1.8 KiB
TypeScript

"use client"
import { useIntl } from "react-intl"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { useMyStayStore } from "@/stores/my-stay"
import PriceDetails from "../../PriceDetails"
import TotalPrice from "../TotalPrice"
import Room from "./Room"
import styles from "./multiRoom.module.css"
import type { SafeUser } from "@/types/user"
interface MultiRoomProps {
user: SafeUser
}
export default function MultiRoom(props: MultiRoomProps) {
const intl = useIntl()
const { allRoomsAreCancelled, rooms } = useMyStayStore((state) => ({
allRoomsAreCancelled: state.allRoomsAreCancelled,
rooms: state.rooms,
}))
if (rooms.length <= 1) {
return null
}
return (
<div className={styles.wrapper}>
<Typography variant="Title/sm">
<h2 className={styles.title}>
{intl.formatMessage({
defaultMessage: "Your rooms",
})}
</h2>
</Typography>
<div className={styles.container}>
<div className={styles.roomsContainer}>
{rooms.map((booking, index) => (
<Room
key={booking.confirmationNumber}
{...props}
booking={booking}
roomNr={index + 1}
/>
))}
</div>
</div>
<div className={styles.totalContainer}>
<div className={styles.total}>
<Typography variant="Body/Lead text">
<p>
{intl.formatMessage({
defaultMessage: "Booking total",
})}
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
{":"}
</p>
</Typography>
<TotalPrice />
</div>
{allRoomsAreCancelled ? null : <PriceDetails />}
</div>
</div>
)
}