feat(SW-589) Updated after comments
This commit is contained in:
@@ -59,13 +59,11 @@ export default function RoomCard({
|
||||
?.generalTerms
|
||||
}
|
||||
|
||||
function getBreakfastInformation(rate: RateDefinition | undefined) {
|
||||
return rateDefinitions.find((def) => def.rateCode === rate?.rateCode)
|
||||
?.breakfastIncluded
|
||||
}
|
||||
const getBreakfastMessage = (rate: RateDefinition | undefined) => {
|
||||
const breakfastInfo = 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." })
|
||||
@@ -187,7 +185,7 @@ export default function RoomCard({
|
||||
</div>
|
||||
<div className={styles.container}>
|
||||
<Caption color="uiTextHighContrast" type="bold">
|
||||
{breakfastMessage(rates.flexRate)}
|
||||
{getBreakfastMessage(rates.flexRate)}
|
||||
</Caption>
|
||||
{roomConfiguration.status === "NotAvailable" ? (
|
||||
<div className={styles.noRoomsContainer}>
|
||||
|
||||
Reference in New Issue
Block a user