diff --git a/app/cart/page.tsx b/app/cart/page.tsx new file mode 100644 index 0000000..2e23c38 --- /dev/null +++ b/app/cart/page.tsx @@ -0,0 +1,116 @@ +"use client"; +import { useCart } from "@/lib/use-cart"; +import { Container } from "@/components/container"; +import { Heading } from "@/components/heading"; +import { Button } from "@/components/ui/button"; +import { Footer } from "@/components/footer"; +import { Trash2, Plus, Minus, ShoppingBag, ArrowRight } from "lucide-react"; +import Link from "next/link"; + +export default function CartPage() { + const { cart, updateQuantity, removeFromCart, total } = useCart(); + + if (cart.length === 0) { + return ( +
+ +
+
+ +
+ Your cart is empty +

Looks like you haven't added anything to your cart yet.

+ +
+
+
+ ); + } + + return ( +
+ + Shopping Cart + +
+
+ {cart.map((item) => ( +
+
+ {item.name} +
+
+

{item.name}

+

{item.category}

+
+
+ + {item.quantity} + +
+ +
+
+
+
₹{item.price * item.quantity}
+
₹{item.price} each
+
+
+ ))} +
+ +
+
+

Order Summary

+
+
+ Subtotal + ₹{total} +
+
+ Shipping + FREE +
+
+ Tax (GST) + ₹{Math.round(total * 0.18)} +
+
+ Total + ₹{total + Math.round(total * 0.18)} +
+
+ +

+ Secure checkout powered by BharatPay +

+
+
+
+
+
+ ); +}