Files
web/apps/scandic-web/components/Blocks/HotelListing/index.tsx
Erik Tiekstra 339e7195dc fix(BOOK-436): Added new section component and deprecated the other
Approved-by: Chuma Mcphoy (We Ahead)
2025-10-13 08:31:26 +00:00

43 lines
980 B
TypeScript

import { Typography } from "@scandic-hotels/design-system/Typography"
import { getHotelsByCSFilter } from "@/lib/trpc/memoizedRequests"
import { Section } from "@/components/Section"
import HotelListingItem from "./HotelListingItem"
import styles from "./hotelListing.module.css"
import type { HotelListingProps } from "@/types/components/blocks/hotelListing"
export default async function HotelListing({
heading,
locationFilter,
hotelsToInclude,
contentType,
}: HotelListingProps) {
const hotels = await getHotelsByCSFilter({
locationFilter,
hotelsToInclude,
})
if (!hotels.length) {
return null
}
return (
<Section>
<Typography variant="Title/sm">
<h3 className={styles.heading}>{heading}</h3>
</Typography>
{hotels.map((hotelData) => (
<HotelListingItem
key={hotelData.hotel.name}
hotelData={hotelData}
contentType={contentType}
/>
))}
</Section>
)
}