import React from "react";
import Link from "next/link";
import Image from "next/image";
import { useContextElement } from "@/context/Context";
const CartDropdown = () => {
const {cartProducts,totalPrice} = useContextElement()
return (
<>
{cartProducts.length ?
{cartProducts.map((item,i)=>
-
{item.name}
${item.price.toFixed(2)} x {item.quantity}
{/* */}
)}
{/* */}
{/* */}
: Cart is empty
}
{/* */}
Subtotal
${totalPrice.toFixed(2)}
{cartProducts.length ? <>
-
View Cart
-
Checkout
> : -
Continue Shoping
}
>
);
};
export default CartDropdown;