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) { export async function getType(type: string) {
const intl = await getIntl() 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) { switch (type) {
case "OutdoorPool": case "OutdoorPool":
return intl.formatMessage({ id: "Outdoor pool" }) return outdoorPool
case "Sauna": case "Sauna":
return intl.formatMessage({ id: "Sauna" }) return sauna
case "Relax": case "Relax":
return intl.formatMessage({ id: "Relax" }) return relax
case "Gym": case "Gym":
return intl.formatMessage({ id: "Gym" }) return gym
default: default:
return type 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" })} ${intl.formatMessage({ id: "Always open" })}`
: `${intl.formatMessage({ id: "Sat-Sun" })} ${facility.openingDetails.openingHours.weekends.openingTime}-${facility.openingDetails.openingHours.weekends.closingTime}`} : `${intl.formatMessage({ id: "Sat-Sun" })} ${facility.openingDetails.openingHours.weekends.openingTime}-${facility.openingDetails.openingHours.weekends.closingTime}`}
</Body> </Body>
<Body>Placeholder text</Body> <Body>
{/* TODO: Determine what details should be displayed about the facility type */}
</Body>
</div> </div>
</div> </div>
</div> </div>