"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>
  )
}
