import { useState } from 'react'; export default function ProductCard({ product, onAddToCart }) { const [isHovered, setIsHovered] = useState(false); const [isAdded, setIsAdded] = useState(false); const handleAddToCart = () => { onAddToCart(product); setIsAdded(true); setTimeout(() => setIsAdded(false), 2000); }; const renderStars = (rating) => { const stars = []; for (let i = 0; i < 5; i++) { if (i < Math.floor(rating)) { stars.push( ); } else { stars.push( ); } } return stars; }; return (
{product.delivery || 'FREE delivery'}
{/* Add to Cart Button */}