import { useFormContext } from "react-hook-form" import { useIntl } from "react-intl" import Caption from "@/components/TempDesignSystem/Text/Caption" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { getCheckedRoomsCounts } from "../utils" import styles from "../cancelStay.module.css" import type { FormValues, PriceContainerProps, } from "@/types/components/hotelReservation/myStay/cancelStay" export default function PriceContainer({ booking, stayDetails, }: PriceContainerProps) { const intl = useIntl() const { getValues } = useFormContext() const checkedRoomsDetails = getCheckedRoomsCounts(booking, getValues, intl) return (
{intl.formatMessage({ id: "Cancellation cost" })} {stayDetails.nightsText}, {checkedRoomsDetails.adultsText} {checkedRoomsDetails.totalChildren > 0 ? `, ${checkedRoomsDetails.childrenText}` : ""}
0 {booking.currencyCode}
) }