import { Link } from 'react-router-dom' import type { Product } from '../types' import { getCategoryImage, formatPrice } from '../types' import { Heart } from 'lucide-react' import { useWishlistStore } from '../store/wishlistStore' interface ProductCardProps { product: Product } export default function ProductCard({ product }: ProductCardProps) { const { addItem, removeItem, isInWishlist } = useWishlistStore() const isWished = isInWishlist(product.id) const handleWishlistClick = (e: React.MouseEvent) => { e.preventDefault() // prevent navigating to product detail if (isWished) { removeItem(product.id) } else { addItem(product) } } return (
{product.scent.name} {/* Category badge */}
{product.category.name}
{/* Wishlist Button */}

{product.scent.name}

{product.category.name}

{formatPrice(product.variants[0]?.price)} View Details →
) }