import { fetchBillboards } from "@/api/fetchBillboards";
import InfiniteBillboard from "@/components/billboards/InfiniteBillboard";

type BillboardsListSectionProps = {
  filters: {
    province?: string;
    city?: string;
    category?: string;
    sort?: string;
    search?: string;
  };
  token: string;
};

export default async function BillboardsListSection({
  filters,
  token,
}: BillboardsListSectionProps) {
  const initialData = await fetchBillboards(1, 10, filters, token);

  return (
    <InfiniteBillboard
      initialData={initialData}
      filters={filters}
      token={token}
    />
  );
}
