"use client" import { notFound } from "next/navigation" import { useIntl } from "react-intl" import { ChevronRightSmallIcon, InfoCircleIcon } from "@/components/Icons" import Button from "@/components/TempDesignSystem/Button" 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 Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import styles from "./receipt.module.css" import type { BookingConfirmationReceiptProps } from "@/types/components/hotelReservation/bookingConfirmation/receipt" import { BreakfastPackageEnum } from "@/types/enums/breakfast" export default function Receipt({ booking, hotel, room, }: BookingConfirmationReceiptProps) { const intl = useIntl() if (!room) { return notFound() } const breakfastPkgSelected = booking.packages.find( (pkg) => pkg.code === BreakfastPackageEnum.REGULAR_BREAKFAST ) const breakfastPkgIncluded = booking.packages.find( (pkg) => pkg.code === BreakfastPackageEnum.FREE_MEMBER_BREAKFAST ) return (
{intl.formatMessage({ id: "Summary" })}
{room.name} {booking.rateDefinition.isMemberRate ? (
N/A {intl.formatNumber(booking.roomPrice, { currency: booking.currencyCode, style: "currency", })}
) : ( {intl.formatNumber(booking.roomPrice, { currency: booking.currencyCode, style: "currency", })} )} {intl.formatMessage( { id: "booking.adults" }, { totalAdults: booking.adults, } )} {booking.rateDefinition.cancellationText} {intl.formatMessage({ id: "Reservation policy" })}
{room.bedType.description} {intl.formatNumber(0, { currency: booking.currencyCode, style: "currency", })}
{intl.formatMessage({ id: "Breakfast buffet" })} {booking.rateDefinition.breakfastIncluded ?? breakfastPkgIncluded ? ( {intl.formatMessage({ id: "Included" })} ) : null} {breakfastPkgSelected ? ( {intl.formatNumber(breakfastPkgSelected.totalPrice, { currency: breakfastPkgSelected.currency, style: "currency", })} ) : null}
{intl.formatMessage({ id: "Total price" })} {intl.formatNumber(booking.totalPrice, { currency: booking.currencyCode, style: "currency", })}
{intl.formatMessage({ id: "Approx." })} N/A EUR
) }