feat(SW-664): Hotel listing component and queries for content pages

This commit is contained in:
Erik Tiekstra
2024-12-11 14:46:38 +01:00
parent 118f1afafa
commit 3939bf7cdc
32 changed files with 989 additions and 140 deletions

View File

@@ -0,0 +1,40 @@
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.name}
hotel={data}
contentType={contentType}
url={url}
/>
))}
</SectionContainer>
)
}