forked from IT-Cotato/12th-OnGil-FE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecommended-brand-grid-card.tsx
More file actions
44 lines (42 loc) · 1.45 KB
/
recommended-brand-grid-card.tsx
File metadata and controls
44 lines (42 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import Image from 'next/image';
import Link from 'next/link';
import { ProductWithWishlist } from '@/types/domain/product';
import { WishlistButton } from '../product/wishlist-button';
export default function RecommendedBrandGridCard({
product,
}: {
product: ProductWithWishlist;
}) {
const href = `/product/${product.id}?from=${encodeURIComponent('/')}`;
return (
<Link href={href} className="block">
<div className="font-pretendard flex w-41 flex-col gap-1">
<div className="relative">
<Image
src={product.thumbnailImageUrl}
alt={product.name}
width={164}
height={170}
className="h-[170px] w-[164px] object-cover"
/>
<WishlistButton
productId={product.id}
initialIsLiked={product.isLiked || false}
initialWishlistId={product.wishlistId}
className="absolute top-2 right-2"
/>
</div>
<span className="font-extrabold">{product.brandName}</span>
<span className="line-clamp-2 h-14 w-full overflow-hidden text-lg font-medium text-ellipsis">
{product.name}
</span>
<div className="flex w-full gap-2 text-xl font-bold">
{product.discountRate > 0 && (
<span className="text-ongil-teal">{product.discountRate}%</span>
)}
<span>{product.finalPrice.toLocaleString('ko-KR')}</span>
</div>
</div>
</Link>
);
}