text: import Card from "../UI/Card";
  import classes from "./Cart.module.css";
  
  import CartItem from "./CartItem";
  import { useSelector } from "react-redux";
  
  const Cart = (props) => {
    const itemsOnCart = useSelector((state) => state.cart.items);
    return (
      <Card className={classes.cart}>
        <h2>Your Shopping Cart</h2>
        <ul>
          {itemsOnCart.map((ioc) => {
            return (
              <CartItem
                key={ioc.id}
                item={{
                  id: ioc.id,
                  title: ioc.name,
                  quantity: ioc.quantity,
                  total: ioc.totalPrice,
                  price: ioc.price,
                }}
              />
            );
          })}
        </ul>
      </Card>
    );
  };
  
  export default Cart;
  