import { longDateWithYearFormat } from "@scandic-hotels/common/constants/dateFormats" import { dt } from "@scandic-hotels/common/dt" import { getNumberOfNights } from "@scandic-hotels/common/utils/dateFormatting" import { Typography } from "@scandic-hotels/design-system/Typography" import { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter" import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" import styles from "./footer.module.css" import type { FooterProps } from "@/types/components/hotelReservation/myStay/receipt" export default async function Footer({ booking, room }: FooterProps) { const intl = await getIntl() const lang = await getLang() const petRoomPackage = booking.packages.find( (p) => p.code === RoomPackageCodeEnum.PET_ROOM ) return (
{intl.formatMessage({ id: "common.bookingNumber", defaultMessage: "Booking number", })}
{booking.confirmationNumber}
{intl.formatMessage({ id: "common.room", defaultMessage: "Room", })}
{room?.name}
{intl.formatMessage({ id: "myStay.receipt.rate", defaultMessage: "Rate", })}
{booking.rateDefinition.title}
{intl.formatMessage({ id: "common.checkIn", defaultMessage: "Check-in", })}
{dt(booking.checkInDate) .locale(lang) .format(longDateWithYearFormat[lang])}
{intl.formatMessage({ id: "common.checkOut", defaultMessage: "Check-out", })}
{dt(booking.checkOutDate) .locale(lang) .format(longDateWithYearFormat[lang])}
{intl.formatMessage({ id: "myStay.receipt.numberOfNights", defaultMessage: "Number of nights", })}
{getNumberOfNights(booking.checkInDate, booking.checkOutDate)}
{intl.formatMessage({ id: "myStay.receipt.numberOfGuests", defaultMessage: "Number of guests", })}
{intl.formatMessage( { id: "booking.numberOfAdults", defaultMessage: "{adults, plural, one {# adult} other {# adults}}", }, { adults: booking.adults } )} {booking.childrenAges.length > 0 && ( <> {", "} {intl.formatMessage( { id: "booking.numberOfChildren", defaultMessage: "{children, plural, one {# child} other {# children}}", }, { children: booking.childrenAges.length } )} )}
{intl.formatMessage({ id: "myStay.receipt.bedType", defaultMessage: "Bed type", })}
{room?.bedType.mainBed.description}
{petRoomPackage && (
{intl.formatMessage({ id: "booking.roomClassification", defaultMessage: "Room classification", })}
{intl.formatMessage({ id: "common.petFriendly", defaultMessage: "Pet-friendly", })}
)}
{intl.formatMessage({ id: "common.breakfast", defaultMessage: "Breakfast", })}
{booking.rateDefinition.breakfastIncluded ? intl.formatMessage({ id: "common.included", defaultMessage: "Included", }) : intl.formatMessage({ id: "common.notIncluded", defaultMessage: "Not included", })}
) }