From d5810c0b50def661ae2598d62b8c9d6c51345d94 Mon Sep 17 00:00:00 2001 From: Vula Builder Date: Fri, 31 Jul 2026 14:12:36 +0000 Subject: [PATCH] Deploy --- src/app/account/register/page.tsx | 68 +++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/app/account/register/page.tsx diff --git a/src/app/account/register/page.tsx b/src/app/account/register/page.tsx new file mode 100644 index 0000000..bcdb1ef --- /dev/null +++ b/src/app/account/register/page.tsx @@ -0,0 +1,68 @@ +'use client' +import { useState } from 'react' +import { useRouter } from 'next/navigation' +import Link from 'next/link' +import { useCustomerAuth } from '@/hooks/useCustomerAuth' + +export default function AccountRegisterPage() { + const { register, loading, error } = useCustomerAuth() + const router = useRouter() + const [form, setForm] = useState({ first_name: '', last_name: '', email: '', password: '' }) + + const set = (k: string) => (e: React.ChangeEvent) => + setForm(p => ({ ...p, [k]: e.target.value })) + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + try { + await register(form) + router.push('/account/orders') + } catch {} + } + + return ( +
+
+

Create account

+

Track your orders and save your details

+ {error &&
{error}
} +
+
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+ +
+

+ Already have an account?{' '} + Sign in +

+
+
+ ) +}