diff --git a/src/app/cart/page.tsx b/src/app/cart/page.tsx deleted file mode 100644 index b744425..0000000 --- a/src/app/cart/page.tsx +++ /dev/null @@ -1,137 +0,0 @@ -'use client'; - -import { useState } from 'react'; -import { ThemeProvider } from '@/components/theme'; -import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline'; -import { Trash2 } from 'lucide-react'; - -interface CartItem { - id: string; - name: string; - price: number; - quantity: number; - imageSrc: string; -} - -export default function CartPage() { - const [cartItems, setCartItems] = useState([ - { id: '1', name: 'Product 1', price: 29.99, quantity: 1, imageSrc: '/placeholder.jpg' }, - { id: '2', name: 'Product 2', price: 49.99, quantity: 2, imageSrc: '/placeholder.jpg' }, - ]); - - const updateQuantity = (id: string, quantity: number) => { - if (quantity <= 0) { - removeItem(id); - } else { - setCartItems(cartItems.map(item => item.id === id ? { ...item, quantity } : item)); - } - }; - - const removeItem = (id: string) => { - setCartItems(cartItems.filter(item => item.id !== id)); - }; - - const subtotal = cartItems.reduce((sum, item) => sum + item.price * item.quantity, 0); - const tax = subtotal * 0.1; - const total = subtotal + tax; - - return ( - - -
-
-

Shopping Cart

- - {cartItems.length === 0 ? ( -
-

Your cart is empty

-
- ) : ( -
- {/* Cart Items */} -
- {cartItems.map((item) => ( -
-
-
-

{item.name}

-

${item.price.toFixed(2)}

-
-
-
- - {item.quantity} - -
- -
-
- ))} -
- - {/* Cart Summary */} -
-
-

Order Summary

-
-
- Subtotal - ${subtotal.toFixed(2)} -
-
- Tax (10%) - ${tax.toFixed(2)} -
-
- Total - ${total.toFixed(2)} -
-
- -
-
-
- )} -
-
-
- ); -}