"use client"; import Layout from "@/components/layout/Layout"; import Link from "next/link"; import { useState } from "react"; import { useRouter } from "next/navigation"; export default function Register() { const router = useRouter(); const [error, setError] = useState(""); const [clientError, setClientError] = useState(""); const [loading, setLoading] = useState(false); const [name, setName] = useState(""); const [email, setEmail] = useState(""); const [clientId, setClientId] = useState(""); const [password, setPassword] = useState(""); const [confirmPassword, setConfirmPassword] = useState(""); const handleRegister = async (e) => { e.preventDefault(); setError(""); setLoading(true); if (password !== confirmPassword) { setError("Passwords do not match"); setLoading(false); return; } // Placeholder for Client ID validation logic if (clientId === "") { setError("This Client ID does not exist"); setClientError("This Client ID does not exist"); setLoading(false); return; } // Simulate registration process try { // Add your custom user registration logic here setLoading(false); router.push("/client-area"); } catch (error) { setError("Error: " + error.message); setLoading(false); } }; return ( <>

Create An Account

Register

Create an account today to manage your subscription easily

{clientError}

setName(e.target.value)} required />
setEmail(e.target.value)} required />
setClientId(e.target.value)} required />
setPassword(e.target.value)} minLength={8} required />
setConfirmPassword(e.target.value)} minLength={8} required />
{!loading ? ( ) : (
Loading...
)}

Already have an account?{" "} Login {" "} now. Need our help?{" "} Contact Us .

); }