File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { Heart , TrendingUp } from 'lucide-react' ;
3+ import { motion } from 'framer-motion' ;
4+
5+ const ProductCard = ( { product, onClick } ) => {
6+ return (
7+ < motion . div
8+ className = "product-card"
9+ onClick = { ( ) => onClick ( product ) }
10+ initial = { { opacity : 0 , y : 20 } }
11+ whileInView = { { opacity : 1 , y : 0 } }
12+ viewport = { { once : true } }
13+ whileHover = { { y : - 5 } }
14+ >
15+ < div className = "card-image-wrap" >
16+ < img src = { product . image } alt = { product . name } loading = "lazy" />
17+
18+ { product . isTrending && (
19+ < div className = "badge-trending" >
20+ < TrendingUp size = { 14 } />
21+ < span > Trending</ span >
22+ </ div >
23+ ) }
24+
25+ < button className = "wishlist-overlay" aria-label = "Add to wishlist" >
26+ < Heart size = { 20 } />
27+ </ button >
28+
29+ < div className = "quick-add" >
30+ < button > QUICK ADD</ button >
31+ </ div >
32+ </ div >
33+
34+ < div className = "card-info" >
35+ < div className = "brand" > { product . brand } </ div >
36+ < h3 className = "name" > { product . name } </ h3 >
37+ < p className = "category" > { product . category } </ p >
38+ < div className = "price" > ₹ { product . price } </ div >
39+ </ div >
40+
41+ </ motion . div >
42+ ) ;
43+ } ;
44+
45+ export default ProductCard ;
You can’t perform that action at this time.
0 commit comments