import { notFound } from "next/navigation" import { filterOverlappingDates } from "@scandic-hotels/booking-flow/utils/SelectRate" import { AlertTypeEnum } from "@scandic-hotels/common/constants/alert" import { dt } from "@scandic-hotels/common/dt" import { Alert } from "@scandic-hotels/design-system/Alert" import { Divider } from "@scandic-hotels/design-system/Divider" import { getBookingConfirmation } from "@/lib/trpc/memoizedRequests" import HotelDetails from "@/components/HotelReservation/BookingConfirmation/HotelDetails" import PaymentDetails from "@/components/HotelReservation/BookingConfirmation/PaymentDetails" import Promos from "@/components/HotelReservation/BookingConfirmation/Promos" import Receipt from "@/components/HotelReservation/BookingConfirmation/Receipt" import Rooms from "@/components/HotelReservation/BookingConfirmation/Rooms" import SidePanel from "@/components/HotelReservation/SidePanel" import { getIntl } from "@/i18n" import BookingConfirmationProvider from "@/providers/BookingConfirmationProvider" import Confirmation from "./Confirmation" import Tracking from "./Tracking" import { mapRoomState } from "./utils" import styles from "./bookingConfirmation.module.css" import type { BookingConfirmationProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation" export default async function BookingConfirmation({ refId, membershipFailedError, }: BookingConfirmationProps) { const bookingConfirmation = await getBookingConfirmation(refId) if (!bookingConfirmation) { return notFound() } const { booking, hotel, room, roomCategories } = bookingConfirmation if (!room) { return notFound() } const intl = await getIntl() return (
{membershipFailedError && ( )} {filterOverlappingDates( hotel.specialAlerts, dt(booking.checkInDate), dt(booking.checkOutDate) ).map((alert) => (
))}
) }