function ColorFilter() {
const { data, isLoading, loadMore, hasMore } = useProductsByFacet({
facet: 'color=Black',
limit: 50
});
return (
<div>
<h2>Black Products</h2>
{data?.products.map(product => (
<ProductCard key={product.id} product={product} />
))}
{hasMore && <button onClick={loadMore}>Load More</button>}
</div>
);
}
Hook to fetch products matching a specific facet value with Load More pagination