diff --git a/shopping-cart/src/Cart.jsx b/shopping-cart/src/Cart.jsx index e69de29..44b5c76 100644 --- a/shopping-cart/src/Cart.jsx +++ b/shopping-cart/src/Cart.jsx @@ -0,0 +1,30 @@ +const Cart = (props) => { + return ( +
+ {props.cart ? ( +
+

Cart

+ {props.cart.map((item) => + + )} +
+ ) : (

Your cart is empty

)} + +
+ ) +} + + +function CartItem({item, qty}) { + const {name, price, img} = item; + + return ( +
+ {name} +

{name}

+

Qty: {qty}

+

{price}

+

{price * qty}

+
+ ) +} \ No newline at end of file