"use client" import { useIntl } from "react-intl" import { formatPrice } from "@/utils/numberFormatting" import BoldRow from "./Row/Bold" import RegularRow from "./Row/Regular" import Tbody from "./Tbody" import type { BreakfastPackage } from "@/types/components/hotelReservation/breakfast" import type { Child } from "@/types/components/hotelReservation/selectRate/selectRate" interface BreakfastProps { adults: number breakfast: BreakfastPackage | false | undefined | null breakfastIncluded: boolean childrenInRoom: Child[] | undefined currency: string nights: number } export default function Breakfast({ adults, breakfast, breakfastIncluded, childrenInRoom, currency, nights, }: BreakfastProps) { const intl = useIntl() if (breakfastIncluded) { const included = intl.formatMessage({ defaultMessage: "Included" }) return ( {childrenInRoom?.length ? ( ) : null} ) } if (!breakfast) { return null } const breakfastAdultsPricePerNight = formatPrice( intl, breakfast.localPrice.price * adults, breakfast.localPrice.currency ) const breakfastAdultsTotalPrice = formatPrice( intl, breakfast.localPrice.price * adults * nights, breakfast.localPrice.currency ) return ( {childrenInRoom?.length ? ( ) : null} ) }