feat(SW-880): refactor getType

This commit is contained in:
Fredrik Thorsson
2024-11-14 14:10:51 +01:00
parent 32c444117d
commit c7327e07bf
2 changed files with 14 additions and 5 deletions

View File

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

View File

@@ -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}`}
</Body>
<Body>Placeholder text</Body>
<Body>
{/* TODO: Determine what details should be displayed about the facility type */}
</Body>
</div>
</div>
</div>