Files
web/components/Blocks/HotelListing/index.tsx
Erik Tiekstra bcfa84324f Merged in feat/SW-1456-country-dynamic-map (pull request #1310)
feat(SW-1456): Added map and fetching hotels by country

* feat(SW-1456): Added map and fetching hotels by country


Approved-by: Fredrik Thorsson
Approved-by: Matilda Landström
2025-02-12 09:15:33 +00:00

41 lines
972 B
TypeScript

import { getHotelsByCSFilter } 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 getHotelsByCSFilter({
locationFilter,
hotelsToInclude: hotelsToInclude,
})
if (!hotels.length) {
return null
}
return (
<SectionContainer>
<Title level="h4" as="h3" textTransform="capitalize">
{heading}
</Title>
{hotels.map(({ url, ...data }) => (
<HotelListingItem
key={data.hotel.name}
hotel={data.hotel}
contentType={contentType}
url={url}
/>
))}
</SectionContainer>
)
}