feat(SW-251): type assertion

This commit is contained in:
Fredrik Thorsson
2024-09-12 13:48:27 +02:00
parent 21ff8f8b5d
commit 85460e95e5
5 changed files with 29 additions and 24 deletions

View File

@@ -9,13 +9,11 @@ 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} />
<HotelCard key={hotel.hotelData.name} hotel={hotel} />
))
) : (
<Title>No hotels found</Title>