```jsx import React from 'react'; import { MapPin, Box, Truck, Info } from 'lucide-react'; // TypeScript interfaces for our data structures interface Address { fullName: string; phoneNumber: string; street: string; city: string; state: string; country: string; zipCode: string; } interface OrderItem { id: string; name: string; price: number; quantity: number; image: string; size?: string; color?: string; } interface ShippingMethod { id: string; name: string; price: number; estimatedDeliveryWindow: { from: string; to: string; }; } interface CheckoutPageProps { shippingAddress: Address; orderItems: OrderItem[]; shippingMethods: ShippingMethod[]; selectedShippingMethod: string; onShippingMethodChange: (id: string) => void; onEditAddress: () => void; onViewOrderDetails: () => void; } export default function CheckoutPage({ shippingAddress, orderItems, shippingMethods, selectedShippingMethod, onShippingMethodChange, onEditAddress, onViewOrderDetails, }: CheckoutPageProps) { // Calculate order summary const subtotal = orderItems.reduce((sum, item) => sum + (item.price * item.quantity), 0); const selectedShipping = shippingMethods.find(method => method.id === selectedShippingMethod); const shippingFee = selectedShipping?.price || 0; const salesTax = subtotal * 0.0825; // Example tax rate of 8.25% const total = subtotal + shippingFee + salesTax; return (
{/* Left Column */}
{/* Shipping Address */}

SHIPPING ADDRESS

{shippingAddress.fullName}

{shippingAddress.phoneNumber}

{shippingAddress.street}, {shippingAddress.city}, {shippingAddress.state}, {shippingAddress.country}, {shippingAddress.zipCode}

{/* Order Details */}

ORDER DETAILS

{orderItems.map((item) => (
{item.name}

{item.name}

{item.size && `Size: ${item.size}`} {item.color && ` • Color: ${item.color}`}

Quantity: {item.quantity}

${(item.price * item.quantity).toFixed(2)}

))}

Total Items: {orderItems.reduce((sum, item) => sum + item.quantity, 0)}

{/* Shipping Methods */}

SHIPPING METHODS

{shippingMethods.map((method) => (
onShippingMethodChange(method.id)} className="w-4 h-4 text-blue-600" />
${method.price.toFixed(2)}

Estimated Delivery Window: {method.estimatedDeliveryWindow.from} - {method.estimatedDeliveryWindow.to}

))}
{/* Right Column - Order Summary */}

ORDER SUMMARY

Subtotal: ${subtotal.toFixed(2)}
Shipping Fees: ${shippingFee.toFixed(2)}
On-Time Delivery Guarantee: Free
Sales Tax: ${salesTax.toFixed(2)}
Total: ${total.toFixed(2)}
Reward {subtotal.toFixed(2)} DRESSIN Points
{/* Rest of the order summary section remains the same */}
); } ```