"use client"; import Link from "next/link"; import { useMemo, useState } from "react"; export default function RegisterPage() { const [step, setStep] = useState(1); const [form, setForm] = useState({ fullName: "", email: "", phone: "", company: "", address: "" }); const [errors, setErrors] = useState>({}); const [loading, setLoading] = useState(false); const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; const phonePattern = /^\+?[0-9]{10,15}$/; function validateStep1() { const nextErrors: Record = {}; if (!form.fullName.trim()) nextErrors.fullName = "This field is required."; if (!form.email.trim()) nextErrors.email = "This field is required."; else if (!emailPattern.test(form.email)) nextErrors.email = "Please enter a valid email address (e.g. name@domain.com)."; if (!form.phone.trim()) nextErrors.phone = "This field is required."; else if (!phonePattern.test(form.phone)) nextErrors.phone = "Phone number must be 10–15 digits, with optional country code."; setErrors(nextErrors); return Object.keys(nextErrors).length === 0; } function handleNext() { if (validateStep1()) setStep(2); } function handleSubmit() { setLoading(true); setTimeout(() => { setLoading(false); window.location.href = "/client"; }, 600); } const progressSteps: Array<[number, string, boolean]> = [ [1, "بياناتك", step >= 1], [2, "التفضيلات", step >= 2], [3, "التأكيد", step >= 3], ]; const summaryRows = useMemo( () => [ ["Full Name", form.fullName || "—"], ["Email", form.email || "—"], ["Phone", form.phone || "—"], ["Company", form.company || "—"], ["Address", form.address || "—"], ], [form], ); return (

تسجيل العميل

إنشاء حساب LogiFlow

العودة لتسجيل الدخول
{progressSteps.map(([index, label, done]) => (
{index}
{label} {index < 3 ? : null}
))}
{step === 1 ? (

المعلومات الشخصية

أكمل الحقول المطلوبة للانتقال إلى خطوة التأكيد.