feat(SW-176): add enum
This commit is contained in:
@@ -107,7 +107,8 @@ export default async function SectionsPage({
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div>Hotel Card TBI</div>
|
||||
{/* TODO: Add Hotel Listing Card */}
|
||||
<div>Hotel Listing Card TBI</div>
|
||||
|
||||
<div className={styles.content}>
|
||||
<div className={styles.main}>
|
||||
|
||||
@@ -11,6 +11,7 @@ import { setLang } from "@/i18n/serverContext"
|
||||
|
||||
import styles from "./page.module.css"
|
||||
|
||||
import { AvailabilityEnum } from "@/types/components/hotelReservation/selectHotel/selectHotel"
|
||||
import { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default async function SelectHotelPage({
|
||||
@@ -35,10 +36,12 @@ export default async function SelectHotelPage({
|
||||
|
||||
const { availability } = availabilityResponse
|
||||
|
||||
const filterAvailability = availability.data
|
||||
.filter((hotels) => hotels.attributes.status === "Available")
|
||||
const availableHotels = availability.data
|
||||
.filter((hotels) => hotels.attributes.status === AvailabilityEnum.Available)
|
||||
.flatMap((hotels) => hotels.attributes)
|
||||
|
||||
console.log(availableHotels)
|
||||
|
||||
return (
|
||||
<main className={styles.main}>
|
||||
<section>
|
||||
@@ -56,8 +59,8 @@ export default async function SelectHotelPage({
|
||||
<HotelFilter filters={hotelFilters} />
|
||||
</section>
|
||||
<section className={styles.hotelCards}>
|
||||
{filterAvailability.length ? (
|
||||
filterAvailability.map((hotel) => (
|
||||
{availableHotels.length ? (
|
||||
availableHotels.map((hotel) => (
|
||||
<HotelCard
|
||||
key={hotel.hotelId}
|
||||
checkInDate={hotel.checkInDate}
|
||||
|
||||
@@ -136,6 +136,7 @@
|
||||
"Phone is required": "Telefonnummer er påkrævet",
|
||||
"Phone number": "Telefonnummer",
|
||||
"Please enter a valid phone number": "Indtast venligst et gyldigt telefonnummer",
|
||||
"points": "Point",
|
||||
"Points": "Point",
|
||||
"points": "point",
|
||||
"Points being calculated": "Point udregnes",
|
||||
|
||||
@@ -133,8 +133,8 @@
|
||||
"Phone is required": "Telefon ist erforderlich",
|
||||
"Phone number": "Telefonnummer",
|
||||
"Please enter a valid phone number": "Bitte geben Sie eine gültige Telefonnummer ein",
|
||||
"points": "Punkte",
|
||||
"Points": "Punkte",
|
||||
"points": "Punkte",
|
||||
"Points being calculated": "Punkte werden berechnet",
|
||||
"Points earned prior to May 1, 2021": "Zusammengeführte Punkte vor dem 1. Mai 2021",
|
||||
"Points may take up to 10 days to be displayed.": "Es kann bis zu 10 Tage dauern, bis Punkte angezeigt werden.",
|
||||
|
||||
@@ -141,6 +141,7 @@
|
||||
"Phone is required": "Phone is required",
|
||||
"Phone number": "Phone number",
|
||||
"Please enter a valid phone number": "Please enter a valid phone number",
|
||||
"points": "Points",
|
||||
"Points": "Points",
|
||||
"points": "points",
|
||||
"Points being calculated": "Points being calculated",
|
||||
|
||||
@@ -138,8 +138,8 @@
|
||||
"Phone is required": "Telefonnummer är obligatorisk",
|
||||
"Phone number": "Telefonnummer",
|
||||
"Please enter a valid phone number": "Var vänlig och ange ett giltigt telefonnummer",
|
||||
"points": "poäng",
|
||||
"Points": "Poäng",
|
||||
"points": "poäng",
|
||||
"Points being calculated": "Poäng beräknas",
|
||||
"Points earned prior to May 1, 2021": "Intjänade poäng före den 1 maj 2021",
|
||||
"Points may take up to 10 days to be displayed.": "Det kan ta upp till 10 dagar innan poäng visas.",
|
||||
|
||||
@@ -500,7 +500,7 @@ const bestPricePerNightSchema = z.object({
|
||||
const linksSchema = z.object({
|
||||
links: z.array(
|
||||
z.object({
|
||||
url: z.string(),
|
||||
url: z.string().url(),
|
||||
type: z.string(),
|
||||
})
|
||||
),
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export enum AvailabilityEnum {
|
||||
Available = "Available",
|
||||
NotAvailable = "NotAvailable",
|
||||
}
|
||||
Reference in New Issue
Block a user