From c39baabb03f3d9ffa476f56ef796469f9236aaeb Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Mon, 5 May 2025 08:13:52 +0000 Subject: [PATCH] Merged in fix/SW-2573-children-count-booking-confirmation (pull request #1939) fix(SW-2573): add children count to summary * fix(SW-2573): add children count to summary Approved-by: Michael Zetterberg --- .../Receipt/Room/index.tsx | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Receipt/Room/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Receipt/Room/index.tsx index 52cac6d6f..6701baf3a 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Receipt/Room/index.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Receipt/Room/index.tsx @@ -44,6 +44,25 @@ export default function ReceiptRoom({ (c) => c.bedType === ChildBedTypeEnum.ExtraBed ) + const adultsMsg = intl.formatMessage( + { + defaultMessage: "{totalAdults, plural, one {# adult} other {# adults}}", + }, + { totalAdults: room.adults } + ) + + const guestsParts = [adultsMsg] + if (room.childrenAges?.length) { + const childrenMsg = intl.formatMessage( + { + defaultMessage: + "{totalChildren, plural, one {# child} other {# children}}", + }, + { totalChildren: room.childrenAges.length } + ) + guestsParts.push(childrenMsg) + } + return (
@@ -65,15 +84,7 @@ export default function ReceiptRoom({ )}

- {intl.formatMessage( - { - defaultMessage: - "{totalAdults, plural, one {# adult} other {# adults}}", - }, - { - totalAdults: room.adults, - } - )} + {guestsParts.join(", ")}