"use client" import { useIntl } from "react-intl" import { dt } from "@/lib/dt" import PriceDetailsModal from "@/components/HotelReservation/PriceDetailsModal" import { getIconForFeatureCode } from "@/components/HotelReservation/utils" import { BedDoubleIcon, BookingCodeIcon, CoffeeIcon, ContractIcon, DoorOpenIcon, PersonIcon, } from "@/components/Icons" import RocketLaunch from "@/components/Icons/Refresh" import Image from "@/components/Image" import IconChip from "@/components/TempDesignSystem/IconChip" import Body from "@/components/TempDesignSystem/Text/Body" import Caption from "@/components/TempDesignSystem/Text/Caption" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import { formatPrice } from "@/utils/numberFormatting" import GuestDetails from "./GuestDetails" import PriceDetailsTable from "./PriceDetailsTable" import ToggleSidePeek from "./ToggleSidePeek" import styles from "./room.module.css" import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter" import { BreakfastPackageEnum } from "@/types/enums/breakfast" import type { Hotel, Room } from "@/types/hotel" import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation" import type { User } from "@/types/user" interface RoomProps { booking: BookingConfirmation["booking"] room: | (Room & { bedType: Room["roomTypes"][number] }) | null hotel: Hotel user: User | null } function hasBreakfastPackage( packages: BookingConfirmation["booking"]["packages"] ) { return packages.some( (p) => p.code === BreakfastPackageEnum.REGULAR_BREAKFAST || p.code === BreakfastPackageEnum.FREE_MEMBER_BREAKFAST || p.code === BreakfastPackageEnum.SPECIAL_PACKAGE_BREAKFAST ) } function RoomHeader({ room, hotel, }: { room: RoomProps["room"] hotel: Hotel }) { if (!room) return null return (