- Your cart will be saved. You'll need to log in again to complete your order.
+ Your cart will be saved. You can log in or continue as a guest to complete your order.
- {checkoutError &&
{checkoutError}
}
You'll enter payment details on the next step.
By placing an order you agree to our{' '}
diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx
new file mode 100644
index 0000000..f71e0fc
--- /dev/null
+++ b/src/app/checkout/page.tsx
@@ -0,0 +1,249 @@
+'use client';
+
+import { useEffect, useState } from 'react';
+import Link from 'next/link';
+import { useCart } from '@/lib/cartStore';
+import { loginCustomer } from '@/app/account/actions';
+import Price from '@/components/Price';
+
+export default function CheckoutPage() {
+ const [mounted, setMounted] = useState(false);
+ const [mode, setMode] = useState<'login' | 'guest' | null>(null);
+ const [checkingOut, setCheckingOut] = useState(false);
+ const [checkoutError, setCheckoutError] = useState(null);
+ const [guestData, setGuestData] = useState({
+ fullName: '',
+ email: '',
+ phone: '',
+ address: '',
+ });
+
+ const items = useCart((s) => s.items);
+ const total = useCart((s) => s.total());
+
+ useEffect(() => setMounted(true), []);
+
+ if (!mounted) return null;
+
+ if (items.length === 0) {
+ return (
+