"use client" import { useIntl } from "react-intl" import { Typography } from "@scandic-hotels/design-system/Typography" import { LinkedReservation } from "./LinkedReservation" import { Room } from "./Room" import styles from "./rooms.module.css" import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation" import type { Room as RoomProp } from "@scandic-hotels/trpc/types/hotel" interface BookingConfirmationRoomsProps extends Pick { mainRoom: RoomProp & { bedType: RoomProp["roomTypes"][number] } checkInTime: string checkOutTime: string } export function Rooms({ booking, checkInTime, checkOutTime, mainRoom, }: BookingConfirmationRoomsProps) { const intl = useIntl() return (
{booking.linkedReservations.length ? (

{intl.formatMessage( { id: "booking.roomIndex", defaultMessage: "Room {roomIndex}", }, { roomIndex: 1 } )}

) : null}
{booking.linkedReservations.map((reservation, idx) => (

{intl.formatMessage( { id: "booking.roomIndex", defaultMessage: "Room {roomIndex}", }, { roomIndex: idx + 2 } )}

))}
) }