feat(SW-589): Added correct breakfastMessage, also fixed some small issues
This commit is contained in:
@@ -59,6 +59,25 @@ export default function RoomCard({
|
||||
?.generalTerms
|
||||
}
|
||||
|
||||
function getBreakfastInformation(rate: RateDefinition | undefined) {
|
||||
return rateDefinitions.find((def) => def.rateCode === rate?.rateCode)
|
||||
?.breakfastIncluded
|
||||
}
|
||||
|
||||
const breakfastMessage = (rate: RateDefinition | undefined) => {
|
||||
const breakfastInfo = getBreakfastInformation(rate)
|
||||
switch (breakfastInfo) {
|
||||
case true:
|
||||
return intl.formatMessage({ id: "Breakfast is included." })
|
||||
case false:
|
||||
return intl.formatMessage({ id: "Breakfast selection in next step." })
|
||||
default:
|
||||
return intl.formatMessage({
|
||||
id: "Breakfast deal can be purchased at the hotel.",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const petRoomPackage =
|
||||
(selectedPackages.includes(RoomPackageCodeEnum.PET_ROOM) &&
|
||||
packages?.find((pkg) => pkg.code === RoomPackageCodeEnum.PET_ROOM)) ||
|
||||
@@ -168,9 +187,7 @@ export default function RoomCard({
|
||||
</div>
|
||||
<div className={styles.container}>
|
||||
<Caption color="uiTextHighContrast" type="bold">
|
||||
{intl.formatMessage({
|
||||
id: "Breakfast selection in next step.",
|
||||
})}
|
||||
{breakfastMessage(rates.flexRate)}
|
||||
</Caption>
|
||||
{roomConfiguration.status === "NotAvailable" ? (
|
||||
<div className={styles.noRoomsContainer}>
|
||||
|
||||
Reference in New Issue
Block a user