Feat(SW-1279) mystay multirum cancelling * feat(SW-1279) Cancelation text if non-user on room 2-4 * feat(SW-1279) cancel mystay multiroom * feat(SW-1279): Added cancellation for multiroom on mystay Approved-by: Niclas Edenvin
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
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<FormValues>()
|
|
|
|
const checkedRoomsDetails = getCheckedRoomsCounts(booking, getValues, intl)
|
|
|
|
return (
|
|
<div className={styles.priceContainer}>
|
|
<div className={styles.info}>
|
|
<Caption color="uiTextHighContrast" type="bold">
|
|
{intl.formatMessage({ id: "Cancellation cost" })}
|
|
</Caption>
|
|
<Caption color="uiTextHighContrast">
|
|
{stayDetails.nightsText}, {checkedRoomsDetails.adultsText}
|
|
{checkedRoomsDetails.totalChildren > 0
|
|
? `, ${checkedRoomsDetails.childrenText}`
|
|
: ""}
|
|
</Caption>
|
|
</div>
|
|
<div className={styles.price}>
|
|
<Subtitle color="burgundy" type="one">
|
|
0 {booking.currencyCode}
|
|
</Subtitle>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|