import { cookies } from "next/headers" import FnFNotAllowedAlert from "@scandic-hotels/booking-flow/components/FnFNotAllowedAlert" import { HotelDetailsSidePeek } from "@scandic-hotels/booking-flow/components/HotelDetailsSidePeek" import { hasOverlappingDates } from "@scandic-hotels/booking-flow/utils/SelectRate" import { FamilyAndFriendsCodes } from "@scandic-hotels/common/constants/familyAndFriends" import { dt } from "@scandic-hotels/common/dt" import { HotelInfoCard } from "@scandic-hotels/design-system/HotelInfoCard" import { RoomsContainer } from "@/components/HotelReservation/SelectRate/RoomsContainer" import { getIntl } from "@/i18n" import { mapApiImagesToGalleryImages } from "@/utils/imageGallery" import AvailabilityError from "./AvailabilityError" import Tracking from "./Tracking" import type { SelectRateBooking } from "@scandic-hotels/booking-flow/types/components/selectRate/selectRate" import type { RouterOutput } from "@scandic-hotels/trpc/client" export default async function SelectRatePage({ booking, hotelData, }: { hotelData: NonNullable booking: SelectRateBooking }) { const intl = await getIntl() const bookingCode = booking.bookingCode let isInValidFNF = false if (bookingCode && FamilyAndFriendsCodes.includes(bookingCode)) { const cookieStore = await cookies() isInValidFNF = cookieStore.get("sc")?.value !== "1" } const validAlerts = hotelData.hotel.specialAlerts.filter((alert) => hasOverlappingDates(alert, dt(booking.fromDate), dt(booking.toDate)) ) return ( <> ({ ...alert, heading: alert.heading ?? "", text: alert.text ?? "", }))} facilities={hotelData.hotel.detailedFacilities} slot={ } /> {isInValidFNF ? ( ) : ( )} ) }