feat(SW-251): use parallel fetch for hotels

This commit is contained in:
Fredrik Thorsson
2024-09-11 10:22:01 +02:00
parent 8c530658c5
commit 43e58dcf01
9 changed files with 126 additions and 75 deletions

View File

@@ -0,0 +1,5 @@
.hotelCards {
display: flex;
flex-direction: column;
gap: var(--Spacing-x4);
}

View File

@@ -0,0 +1,25 @@
"use client"
import Title from "@/components/TempDesignSystem/Text/Title"
import HotelCard from "../HotelCard"
import styles from "./hotelCardListing.module.css"
import { HotelCardListingProps } from "@/types/components/hotelReservation/selectHotel/hotelCardListingProps"
export default function HotelCardListing({ hotelData }: HotelCardListingProps) {
if (!hotelData) return null
return (
<section className={styles.hotelCards}>
{hotelData && hotelData.length ? (
hotelData.map((hotel) => (
<HotelCard key={hotel.hotelData?.name} hotel={hotel} />
))
) : (
<Title>Hallå</Title>
)}
</section>
)
}