From 5bf165866ad6c78bc0ca35dad8625b87e0af773c Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Fri, 11 Oct 2024 15:30:59 +0200 Subject: [PATCH] feat(SW-415): Improvements --- .../RoomSelection/RoomCard/index.tsx | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx index 58533eefe..d6d038379 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx +++ b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx @@ -57,22 +57,14 @@ export default function RoomCard({ return rateDefinitions.find((def) => def.rateCode === rate?.rateCode) ?.generalTerms } - - const roomSize = roomCategories.find( + const selectedRoom = roomCategories.find( (room) => room.name === roomConfiguration.roomType - )?.roomSize + ) - const occupancy = roomCategories.find( - (room) => room.name === roomConfiguration.roomType - )?.occupancy.total - - const roomDescription = roomCategories.find( - (room) => room.name === roomConfiguration.roomType - )?.descriptions.short - - const images = roomCategories.find( - (room) => room.name === roomConfiguration.roomType - )?.images + const roomSize = selectedRoom?.roomSize + const occupancy = selectedRoom?.occupancy.total + const roomDescription = selectedRoom?.descriptions.short + const images = selectedRoom?.images const mainImage = images?.[0] return (