import React from "react"; import Link from "next/link"; import { useContextElement } from "@/context/Context"; const CartTotal = () => { const {totalPrice,cartProducts} = useContextElement() return ( <>
Subtotal ${totalPrice.toFixed(2)}
Shipping Cost ${(cartProducts.length * 10).toFixed(2)}
Total ${((cartProducts.length * 10) + (totalPrice)).toFixed(2)}
{/* */} Checkout ); }; export default CartTotal;