anycoder-044de774 / components /ProductGrid.js
mouris030's picture
Upload components/ProductGrid.js with huggingface_hub
10b91fd verified
Raw History Blame Contribute Delete
986 Bytes
import ProductCard from './ProductCard';
export default function ProductGrid({ products, onAddToCart }) {
if (!products || products.length === 0) {
return (
<div className="bg-white rounded-lg shadow-md p-8 text-center">
<svg className="w-16 h-16 mx-auto text-gray-400 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<h3 className="text-lg font-medium text-gray-600 mb-2">No products found</h3>
<p className="text-sm text-gray-500">Try adjusting your search or filter criteria</p>
</div>
);
}
return (
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
{products.map((product) => (
<ProductCard key={product.id} product={product} onAddToCart={onAddToCart} />
))}
</div>
);
}