From d6655de8b59ae9d45156e71b76cf3f7a30e44529 Mon Sep 17 00:00:00 2001 From: 1399e949 <166954908+1399e949@users.noreply.github.com> Date: Sat, 31 May 2025 06:20:11 -0300 Subject: [PATCH] Create E --- E | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 E diff --git a/E b/E new file mode 100644 index 000000000..b35a04eec --- /dev/null +++ b/E @@ -0,0 +1,38 @@ +// src/pages/Checkout.js +import React from "react"; +import { useCart } from "../store/cart"; + +export default function Checkout() { + const { cart, clearCart } = useCart(); + + const total = cart.reduce((acc, item) => acc + item.price, 0).toFixed(2); + + const handleCheckout = () => { + alert("Pedido finalizado com sucesso!"); + clearCart(); + }; + + return ( +
Seu carrinho está vazio.
+ ) : ( +Total: R$ {total}
+ +