"use client"; import { buildPageItems } from "@/components/catalog/utils"; import styles from "@/components/BusinessDetailsPage.module.css"; export default function CatalogPagination({ page, total, pageSize, onChange, busy, }: { page: number; total: number; pageSize: number; onChange: (page: number) => void; busy?: boolean; }) { const pageCount = Math.max(1, Math.ceil(total / pageSize)); if (total <= pageSize) return null; const items = buildPageItems(page, pageCount); return (
{items.map((item, index) => item === "…" ? ( … ) : ( ), )}
); }