41 lines
949 B
TypeScript
41 lines
949 B
TypeScript
import { getHotels } from "@/lib/trpc/memoizedRequests"
|
|
|
|
import SectionContainer from "@/components/Section/Container"
|
|
import Title from "@/components/TempDesignSystem/Text/Title"
|
|
|
|
import HotelListingItem from "./HotelListingItem"
|
|
|
|
import type { HotelListingProps } from "@/types/components/blocks/hotelListing"
|
|
|
|
export default async function HotelListing({
|
|
heading,
|
|
locationFilter,
|
|
hotelsToInclude,
|
|
contentType,
|
|
}: HotelListingProps) {
|
|
const hotels = await getHotels({
|
|
locationFilter,
|
|
hotelsToInclude: hotelsToInclude,
|
|
})
|
|
|
|
if (!hotels.length) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<SectionContainer>
|
|
<Title level="h4" as="h3" textTransform="capitalize">
|
|
{heading}
|
|
</Title>
|
|
{hotels.map(({ data, url }) => (
|
|
<HotelListingItem
|
|
key={data.hotel.name}
|
|
hotel={data.hotel}
|
|
contentType={contentType}
|
|
url={url}
|
|
/>
|
|
))}
|
|
</SectionContainer>
|
|
)
|
|
}
|