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}
|
||||
|
||||
Reference in New Issue
Block a user