From 4fd9a7d2b88cd86911c81750d2d352ea9238ae7a Mon Sep 17 00:00:00 2001 From: bender Date: Mon, 23 Mar 2026 21:48:20 +0000 Subject: [PATCH] Add src/components/cart/CartItem.tsx --- src/components/cart/CartItem.tsx | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/components/cart/CartItem.tsx diff --git a/src/components/cart/CartItem.tsx b/src/components/cart/CartItem.tsx new file mode 100644 index 0000000..2c793c1 --- /dev/null +++ b/src/components/cart/CartItem.tsx @@ -0,0 +1,53 @@ +'use client'; + +import React from 'react'; +import Image from 'next/image'; +import { Minus, Plus, Trash2 } from 'lucide-react'; + +interface CartItemProps { + item: { id: string; name: string; price: number; quantity: number; imageSrc: string; imageAlt?: string }; + onUpdateQuantity: (productId: string, newQuantity: number) => void; + onRemove: (productId: string) => void; +} + +export const CartItem = ({ item, onUpdateQuantity, onRemove }: CartItemProps) => { + return ( +
+
+
+ {item.imageAlt +
+
+

{item.name}

+

${item.price.toFixed(2)}

+
+
+
+
+ + {item.quantity} + +
+ +
+
+ ); +};