feat(SW-589) Updated after comments

This commit is contained in:
Pontus Dreij
2024-11-18 16:41:02 +01:00
committed by Joakim Jäderberg
parent dac345371b
commit 43d760eedb

View File

@@ -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}>