From c7d285de74cca5bbb2cb1ef77f83d836fc6e2c86 Mon Sep 17 00:00:00 2001 From: Fredrik Thorsson Date: Thu, 14 Nov 2024 14:10:51 +0100 Subject: [PATCH] feat(SW-880): refactor getType --- .../HotelPage/SidePeeks/Utils/getType.ts | 15 +++++++++++---- .../SidePeeks/WellnessAndExercise/index.tsx | 4 +++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/components/ContentType/HotelPage/SidePeeks/Utils/getType.ts b/components/ContentType/HotelPage/SidePeeks/Utils/getType.ts index 33e39b220..47cbf00da 100644 --- a/components/ContentType/HotelPage/SidePeeks/Utils/getType.ts +++ b/components/ContentType/HotelPage/SidePeeks/Utils/getType.ts @@ -2,15 +2,22 @@ import { getIntl } from "@/i18n" export async function getType(type: string) { const intl = await getIntl() + + /* TODO: Get full list of types */ + const outdoorPool = intl.formatMessage({ id: "Outdoor pool" }) + const sauna = intl.formatMessage({ id: "Sauna" }) + const relax = intl.formatMessage({ id: "Relax" }) + const gym = intl.formatMessage({ id: "Gym" }) + switch (type) { case "OutdoorPool": - return intl.formatMessage({ id: "Outdoor pool" }) + return outdoorPool case "Sauna": - return intl.formatMessage({ id: "Sauna" }) + return sauna case "Relax": - return intl.formatMessage({ id: "Relax" }) + return relax case "Gym": - return intl.formatMessage({ id: "Gym" }) + return gym default: return type } diff --git a/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx b/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx index ee9f01b85..6bd73d703 100644 --- a/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx +++ b/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx @@ -55,7 +55,9 @@ export default async function WellnessAndExerciseSidePeek({ ? `${intl.formatMessage({ id: "Sat-Sun" })} ${intl.formatMessage({ id: "Always open" })}` : `${intl.formatMessage({ id: "Sat-Sun" })} ${facility.openingDetails.openingHours.weekends.openingTime}-${facility.openingDetails.openingHours.weekends.closingTime}`} - Placeholder text + + {/* TODO: Determine what details should be displayed about the facility type */} +