import { Typography } from "@scandic-hotels/design-system/Typography" import { dt } from "@/lib/dt" import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" import { getNumberOfNights } from "@/utils/dateFormatting" import styles from "./footer.module.css" import type { FooterProps } from "@/types/components/hotelReservation/myStay/receipt" import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter" export default async function Footer({ booking, room }: FooterProps) { const intl = await getIntl() const lang = getLang() const petRoomPackage = booking.packages.find( (p) => p.code === RoomPackageCodeEnum.PET_ROOM ) return (
{intl.formatMessage({ id: "Reference number" })}
{booking.confirmationNumber}
{intl.formatMessage({ id: "Room" })}
{room?.name}
{intl.formatMessage({ id: "Rate" })}
{booking.rateDefinition.title}
{intl.formatMessage({ id: "Check-in" })}
{dt(booking.checkInDate).locale(lang).format("ddd, D MMM YYYY")}
{intl.formatMessage({ id: "Check-out" })}
{dt(booking.checkOutDate).locale(lang).format("ddd, D MMM YYYY")}
{intl.formatMessage({ id: "Number of nights" })}
{getNumberOfNights(booking.checkInDate, booking.checkOutDate)}
{intl.formatMessage({ id: "Number of guests" })}
{intl.formatMessage( { id: "{adults, plural, one {# adult} other {# adults}}" }, { adults: booking.adults } )} {booking.childrenAges.length > 0 && ( <> {", "} {intl.formatMessage( { id: "{children, plural, one {# child} other {# children}}", }, { children: booking.childrenAges.length } )} )}
{intl.formatMessage({ id: "Bed type" })}
{room?.bedType.mainBed.description}
{petRoomPackage && (
{intl.formatMessage({ id: "Room classification" })}
{intl.formatMessage({ id: "Pet-friendly" })}
)}
{intl.formatMessage({ id: "Breakfast" })}
{booking.rateDefinition.breakfastIncluded ? intl.formatMessage({ id: "Included" }) : intl.formatMessage({ id: "Not included" })}
) }