import { notFound } from "next/navigation" import { Divider } from "@scandic-hotels/design-system/Divider" import { AlertTypeEnum } from "@scandic-hotels/trpc/types/alertType" 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 Alert from "@/components/TempDesignSystem/Alert" import { getIntl } from "@/i18n" import BookingConfirmationProvider from "@/providers/BookingConfirmationProvider" import { getHotelAlertsForBookingDates } from "../utils" 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 && ( )} {getHotelAlertsForBookingDates( hotel.specialAlerts, booking.checkInDate, booking.checkOutDate ).map((alert) => (
))}
) }