import { profile } from "@/constants/routes/myPages" import { dt } from "@/lib/dt" import { getBookingConfirmation, getProfileSafely, } from "@/lib/trpc/memoizedRequests" import { CreditCardAddIcon, EditIcon, PersonIcon } from "@/components/Icons" import Divider from "@/components/TempDesignSystem/Divider" import Link from "@/components/TempDesignSystem/Link" import Body from "@/components/TempDesignSystem/Text/Body" import Caption from "@/components/TempDesignSystem/Text/Caption" import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" import styles from "./summary.module.css" import type { BookingConfirmationProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation" import { BreakfastPackageEnum } from "@/types/enums/breakfast" export default async function Summary({ confirmationNumber, }: BookingConfirmationProps) { const intl = await getIntl() const lang = getLang() const { booking, hotel } = await getBookingConfirmation(confirmationNumber) const user = await getProfileSafely() const { firstName, lastName } = booking.guest const membershipNumber = user?.membership?.membershipNumber const totalNights = dt(booking.checkOutDate.setHours(0, 0, 0)).diff( dt(booking.checkInDate.setHours(0, 0, 0)), "days" ) const breakfastPackage = booking.packages.find( (pkg) => pkg.code === BreakfastPackageEnum.REGULAR_BREAKFAST ) return (