diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx new file mode 100644 index 0000000..11de646 --- /dev/null +++ b/src/app/checkout/page.tsx @@ -0,0 +1,264 @@ +'use client'; + +import { useState } from 'react'; +import { ThemeProvider } from '@/providers/themeProvider/ThemeProvider'; +import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen'; +import ButtonHoverBubble from '@/components/button/ButtonHoverBubble'; +import Textarea from '@/components/form/Textarea'; + +const navItems = [ + { name: 'Home', id: '/' }, + { name: 'Shop', id: '/shop' }, + { name: 'Cart', id: '/cart' }, + { name: 'Checkout', id: '/checkout' }, +]; + +interface OrderItem { + id: string; + name: string; + price: number; + quantity: number; +} + +interface FormData { + firstName: string; + lastName: string; + email: string; + address: string; + city: string; + postalCode: string; + notes: string; +} + +export default function CheckoutPage() { + const [formData, setFormData] = useState({ + firstName: '', + lastName: '', + email: '', + address: '', + city: '', + postalCode: '', + notes: '', + }); + + const [orderPlaced, setOrderPlaced] = useState(false); + + // Sample order data + const orderItems: OrderItem[] = [ + { id: '1', name: 'Premium Headphones', price: 199.99, quantity: 1 }, + { id: '2', name: 'Wireless Mouse', price: 49.99, quantity: 2 }, + ]; + + const subtotal = orderItems.reduce((sum, item) => sum + item.price * item.quantity, 0); + const tax = subtotal * 0.1; + const shipping = 10.0; + const total = subtotal + tax + shipping; + + const handleInputChange = (e: React.ChangeEvent) => { + const { name, value } = e.target; + setFormData(prev => ({ ...prev, [name]: value })); + }; + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + // Simulate order placement + setOrderPlaced(true); + }; + + if (orderPlaced) { + return ( + + +
+
+
+
+ +
+

Order Confirmed!

+

+ Thank you for your order. A confirmation email has been sent to {formData.email} +

+
+
+

Order Details

+
+

Name: {formData.firstName} {formData.lastName}

+

Email: {formData.email}

+

Address: {formData.address}, {formData.city} {formData.postalCode}

+

Total: ${total.toFixed(2)}

+
+
+ +
+
+
+ ); + } + + return ( + + +
+
+

Checkout

+ +
+ {/* Checkout Form */} +
+
+
+

Shipping Information

+
+ + +
+ + +
+ + +
+
+ +
+

Order Notes

+