feat(SW-880): add function for type mapping
This commit is contained in:
committed by
Joakim Jäderberg
parent
5206a40754
commit
cf9b2d7fc0
17
components/ContentType/HotelPage/SidePeeks/Utils/getType.ts
Normal file
17
components/ContentType/HotelPage/SidePeeks/Utils/getType.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { getIntl } from "@/i18n"
|
||||
|
||||
export async function getType(type: string) {
|
||||
const intl = await getIntl()
|
||||
switch (type) {
|
||||
case "OutdoorPool":
|
||||
return intl.formatMessage({ id: "Outdoor pool" })
|
||||
case "Sauna":
|
||||
return intl.formatMessage({ id: "Sauna" })
|
||||
case "Relax":
|
||||
return intl.formatMessage({ id: "Relax" })
|
||||
case "Gym":
|
||||
return intl.formatMessage({ id: "Gym" })
|
||||
default:
|
||||
return type
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@ import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import { getIntl } from "@/i18n"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
import { getType } from "../Utils/getType"
|
||||
|
||||
import styles from "./wellnessAndExercise.module.css"
|
||||
|
||||
import { WellnessAndExerciseSidePeekProps } from "@/types/components/hotelPage/sidepeek/wellnessAndExercise"
|
||||
@@ -36,19 +38,19 @@ export default async function WellnessAndExerciseSidePeek({
|
||||
width={200}
|
||||
/>
|
||||
<div className={styles.information}>
|
||||
<Subtitle color="burgundy" asChild>
|
||||
<Title level="h3">{facility.type}</Title>
|
||||
<Subtitle color="burgundy" asChild type="one">
|
||||
<Title level="h3">{getType(facility.type)}</Title>
|
||||
</Subtitle>
|
||||
<div>
|
||||
<Subtitle>
|
||||
<Subtitle type="two" color="uiTextHighContrast">
|
||||
{intl.formatMessage({ id: " Opening Hours" })}
|
||||
</Subtitle>
|
||||
<Body className={styles.body}>
|
||||
<Body color="uiTextHighContrast" className={styles.body}>
|
||||
{facility.openingDetails.openingHours.ordinary.alwaysOpen
|
||||
? `${intl.formatMessage({ id: "Mon-Fri" })} ${intl.formatMessage({ id: "Always open" })}`
|
||||
: `${intl.formatMessage({ id: "Mon-Fri" })} ${facility.openingDetails.openingHours.ordinary.openingTime}-${facility.openingDetails.openingHours.ordinary.closingTime}`}
|
||||
</Body>
|
||||
<Body>
|
||||
<Body color="uiTextHighContrast">
|
||||
{facility.openingDetails.openingHours.weekends.alwaysOpen
|
||||
? `${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}`}
|
||||
|
||||
@@ -143,6 +143,7 @@
|
||||
"Guarantee booking with credit card": "Garantere booking med kreditkort",
|
||||
"Guest information": "Gæsteinformation",
|
||||
"Guests & Rooms": "Gæster & værelser",
|
||||
"Gym": "Fitnesscenter",
|
||||
"Hi": "Hei",
|
||||
"Highest level": "Højeste niveau",
|
||||
"Hospital": "Hospital",
|
||||
@@ -238,6 +239,7 @@
|
||||
"Open menu": "Åbn menuen",
|
||||
"Open my pages menu": "Åbn mine sider menuen",
|
||||
"Opening Hours": "Åbningstider",
|
||||
"Outdoor pool": "Udendørs pool",
|
||||
"Overview": "Oversigt",
|
||||
"PETR": "Kæledyr",
|
||||
"Parking": "Parkering",
|
||||
@@ -278,6 +280,7 @@
|
||||
"Read more & book a table": "Read more & book a table",
|
||||
"Read more about the hotel": "Læs mere om hotellet",
|
||||
"Read more about wellness & exercise": "Read more about wellness & exercise",
|
||||
"Relax": "Slap af",
|
||||
"Remove card from member profile": "Fjern kortet fra medlemsprofilen",
|
||||
"Request bedtype": "Anmod om sengetype",
|
||||
"Restaurant": "{count, plural, one {#Restaurant} other {#Restaurants}}",
|
||||
@@ -290,6 +293,7 @@
|
||||
"Rooms": "Værelser",
|
||||
"Rooms & Guests": "Værelser & gæster",
|
||||
"Sat-Sun": "Lør-Søn",
|
||||
"Sauna": "Sauna",
|
||||
"Sauna and gym": "Sauna and gym",
|
||||
"Save": "Gemme",
|
||||
"Scandic Friends Mastercard": "Scandic Friends Mastercard",
|
||||
|
||||
@@ -143,6 +143,7 @@
|
||||
"Guarantee booking with credit card": "Buchung mit Kreditkarte garantieren",
|
||||
"Guest information": "Informationen für Gäste",
|
||||
"Guests & Rooms": "Gäste & Zimmer",
|
||||
"Gym": "Fitnessstudio",
|
||||
"Hi": "Hallo",
|
||||
"Highest level": "Höchstes Level",
|
||||
"Hospital": "Krankenhaus",
|
||||
@@ -236,6 +237,7 @@
|
||||
"Open menu": "Menü öffnen",
|
||||
"Open my pages menu": "Meine Seiten Menü öffnen",
|
||||
"Opening Hours": "Öffnungszeiten",
|
||||
"Outdoor pool": "Außenpool",
|
||||
"Overview": "Übersicht",
|
||||
"PETR": "Haustier",
|
||||
"Parking": "Parken",
|
||||
@@ -276,6 +278,7 @@
|
||||
"Read more & book a table": "Read more & book a table",
|
||||
"Read more about the hotel": "Lesen Sie mehr über das Hotel",
|
||||
"Read more about wellness & exercise": "Read more about wellness & exercise",
|
||||
"Relax": "Entspannen",
|
||||
"Remove card from member profile": "Karte aus dem Mitgliedsprofil entfernen",
|
||||
"Request bedtype": "Bettentyp anfragen",
|
||||
"Restaurant": "{count, plural, one {#Restaurant} other {#Restaurants}}",
|
||||
@@ -289,6 +292,7 @@
|
||||
"Rooms": "Räume",
|
||||
"Rooms & Guests": "Zimmer & Gäste",
|
||||
"Sat-Sun": "Sa-So",
|
||||
"Sauna": "Sauna",
|
||||
"Sauna and gym": "Sauna and gym",
|
||||
"Save": "Speichern",
|
||||
"Scandic Friends Mastercard": "Scandic Friends Mastercard",
|
||||
|
||||
@@ -155,6 +155,7 @@
|
||||
"Guest": "Guest",
|
||||
"Guest information": "Guest information",
|
||||
"Guests & Rooms": "Guests & Rooms",
|
||||
"Gym": "Gym",
|
||||
"Hi": "Hi",
|
||||
"Highest level": "Highest level",
|
||||
"Hospital": "Hospital",
|
||||
@@ -255,6 +256,7 @@
|
||||
"Open menu": "Open menu",
|
||||
"Open my pages menu": "Open my pages menu",
|
||||
"Opening Hours": "Opening Hours",
|
||||
"Outdoor pool": "Outdoor pool",
|
||||
"Overview": "Overview",
|
||||
"PETR": "Pet",
|
||||
"Parking": "Parking",
|
||||
@@ -304,6 +306,7 @@
|
||||
"Read more about wellness & exercise": "Read more about wellness & exercise",
|
||||
"Rebooking": "Rebooking",
|
||||
"Reference #{bookingNr}": "Reference #{bookingNr}",
|
||||
"Relax": "Relax",
|
||||
"Remove card from member profile": "Remove card from member profile",
|
||||
"Request bedtype": "Request bedtype",
|
||||
"Restaurant": "{count, plural, one {#Restaurant} other {#Restaurants}}",
|
||||
@@ -317,6 +320,7 @@
|
||||
"Rooms": "Rooms",
|
||||
"Rooms & Guests": "Rooms & Guests",
|
||||
"Sat-Sun": "Sat-Sun",
|
||||
"Sauna": "Sauna",
|
||||
"Sauna and gym": "Sauna and gym",
|
||||
"Save": "Save",
|
||||
"Save card to profile": "Save card to profile",
|
||||
|
||||
@@ -143,6 +143,7 @@
|
||||
"Guarantee booking with credit card": "Varmista varaus luottokortilla",
|
||||
"Guest information": "Vieraan tiedot",
|
||||
"Guests & Rooms": "Vieraat & Huoneet",
|
||||
"Gym": "Kuntosali",
|
||||
"Hi": "Hi",
|
||||
"Highest level": "Korkein taso",
|
||||
"Hospital": "Sairaala",
|
||||
@@ -238,6 +239,7 @@
|
||||
"Open menu": "Avaa valikko",
|
||||
"Open my pages menu": "Avaa omat sivut -valikko",
|
||||
"Opening Hours": "Aukioloajat",
|
||||
"Outdoor pool": "Ulkouima-allas",
|
||||
"Overview": "Yleiskatsaus",
|
||||
"PETR": "Lemmikki",
|
||||
"Parking": "Pysäköinti",
|
||||
@@ -278,6 +280,7 @@
|
||||
"Read more & book a table": "Read more & book a table",
|
||||
"Read more about the hotel": "Lue lisää hotellista",
|
||||
"Read more about wellness & exercise": "Read more about wellness & exercise",
|
||||
"Relax": "Rentoutua",
|
||||
"Remove card from member profile": "Poista kortti jäsenprofiilista",
|
||||
"Request bedtype": "Pyydä sänkytyyppiä",
|
||||
"Restaurant": "{count, plural, one {#Ravintola} other {#Restaurants}}",
|
||||
@@ -291,6 +294,7 @@
|
||||
"Rooms & Guests": "Huoneet & Vieraat",
|
||||
"Rooms & Guestss": "Huoneet & Vieraat",
|
||||
"Sat-Sun": "La-Su",
|
||||
"Sauna": "Sauna",
|
||||
"Sauna and gym": "Sauna and gym",
|
||||
"Save": "Tallenna",
|
||||
"Scandic Friends Mastercard": "Scandic Friends Mastercard",
|
||||
|
||||
@@ -142,6 +142,7 @@
|
||||
"Guarantee booking with credit card": "Garantere booking med kredittkort",
|
||||
"Guest information": "Informasjon til gjester",
|
||||
"Guests & Rooms": "Gjester & rom",
|
||||
"Gym": "Treningsstudio",
|
||||
"Hi": "Hei",
|
||||
"Highest level": "Høyeste nivå",
|
||||
"Hospital": "Sykehus",
|
||||
@@ -236,6 +237,7 @@
|
||||
"Open menu": "Åpne menyen",
|
||||
"Open my pages menu": "Åpne mine sider menyen",
|
||||
"Opening Hours": "Åpningstider",
|
||||
"Outdoor pool": "Utendørs basseng",
|
||||
"Overview": "Oversikt",
|
||||
"PETR": "Kjæledyr",
|
||||
"Parking": "Parkering",
|
||||
@@ -276,6 +278,7 @@
|
||||
"Read more & book a table": "Read more & book a table",
|
||||
"Read more about the hotel": "Les mer om hotellet",
|
||||
"Read more about wellness & exercise": "Read more about wellness & exercise",
|
||||
"Relax": "Slappe av",
|
||||
"Remove card from member profile": "Fjern kortet fra medlemsprofilen",
|
||||
"Request bedtype": "Be om sengetype",
|
||||
"Restaurant": "{count, plural, one {#Restaurant} other {#Restaurants}}",
|
||||
@@ -288,6 +291,7 @@
|
||||
"Rooms": "Rom",
|
||||
"Rooms & Guests": "Rom og gjester",
|
||||
"Sat-Sun": "Lør-Søn",
|
||||
"Sauna": "Badstue",
|
||||
"Sauna and gym": "Sauna and gym",
|
||||
"Save": "Lagre",
|
||||
"Scandic Friends Mastercard": "Scandic Friends Mastercard",
|
||||
|
||||
@@ -142,6 +142,7 @@
|
||||
"Guarantee booking with credit card": "Garantera bokning med kreditkort",
|
||||
"Guest information": "Information till gästerna",
|
||||
"Guests & Rooms": "Gäster & rum",
|
||||
"Gym": "Gym",
|
||||
"Hi": "Hej",
|
||||
"Highest level": "Högsta nivå",
|
||||
"Hospital": "Sjukhus",
|
||||
@@ -236,6 +237,7 @@
|
||||
"Open menu": "Öppna menyn",
|
||||
"Open my pages menu": "Öppna mina sidor menyn",
|
||||
"Opening Hours": "Öppettider",
|
||||
"Outdoor pool": "Utomhuspool",
|
||||
"Overview": "Översikt",
|
||||
"PETR": "Husdjur",
|
||||
"Parking": "Parkering",
|
||||
@@ -276,6 +278,7 @@
|
||||
"Read more & book a table": "Read more & book a table",
|
||||
"Read more about the hotel": "Läs mer om hotellet",
|
||||
"Read more about wellness & exercise": "Read more about wellness & exercise",
|
||||
"Relax": "Koppla av",
|
||||
"Remove card from member profile": "Ta bort kortet från medlemsprofilen",
|
||||
"Request bedtype": "Request bedtype",
|
||||
"Restaurant": "{count, plural, one {#Restaurang} other {#Restauranger}}",
|
||||
@@ -288,6 +291,7 @@
|
||||
"Rooms": "Rum",
|
||||
"Rooms & Guests": "Rum och gäster",
|
||||
"Sat-Sun": "Lör-Sön",
|
||||
"Sauna": "Bastu",
|
||||
"Sauna and gym": "Sauna and gym",
|
||||
"Save": "Spara",
|
||||
"Scandic Friends Mastercard": "Scandic Friends Mastercard",
|
||||
|
||||
Reference in New Issue
Block a user