import React, { useContext } from "react"; import "../styles/Product.css"; import ShoppingBasketIcon from "@mui/icons-material/ShoppingCart"; import { Link } from "react-router-dom"; import { Store } from "../Store"; import CheckIcon from "@mui/icons-material/Check"; import ClearIcon from "@mui/icons-material/Clear"; function Product({ product }) { const { state, dispatch: ctxDispatch } = useContext(Store); const addToCartHandler = () => { ctxDispatch({ type: "CART_ADD_ITEM", payload: { ...product, quantity: 1 }, }); }; return (