import { getHotelsByCSFilter } from "@/lib/trpc/memoizedRequests"

import CampaignHotelListingClient from "./Client"

interface CampaignHotelListingProps {
  heading: string
  hotelIds: string[]
}

export default async function CampaignHotelListing({
  heading,
  hotelIds,
}: CampaignHotelListingProps) {
  const hotels = await getHotelsByCSFilter({ hotelsToInclude: hotelIds })

  if (!hotels.length) {
    return null
  }

  return <CampaignHotelListingClient heading={heading} hotels={hotels} />
}
