"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 Login() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); const [isLoading, setIsLoading] = useState(false); const [wrongCred, setWrongCred] = useState(false); const router = useRouter(); const handleLogin = async (e) => { e.preventDefault(); setError(""); setIsLoading(true); // Simulate a login validation (replace this with actual logic or API calls) if (email === "test@example.com" && password === "password123") { // Successful login simulation router.push("/client-area"); } else { setError("Invalid login credentials, please try again."); setWrongCred(true); } setIsLoading(false); }; return ( <>

Client Area

Login with your email

Invalid login credentials, please try again.

setEmail(e.target.value)} required />
setPassword(e.target.value)} minLength={8} required />
Forgot Password ?
{!isLoading ? ( ) : (
Loading...
)}

Don’t have an account?{" "} Register {" "} now

); }