diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx new file mode 100644 index 0000000..676d788 --- /dev/null +++ b/src/app/login/page.tsx @@ -0,0 +1,188 @@ +"use client"; + +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import NavbarStyleCentered from "@/components/navbar/NavbarStyleCentered/NavbarStyleCentered"; +import FooterBase from "@/components/sections/footer/FooterBase"; +import Input from "@/components/form/Input"; +import ButtonHoverMagnetic from "@/components/button/ButtonHoverMagnetic/ButtonHoverMagnetic"; +import { useState } from "react"; +import { Lock, Mail } from "lucide-react"; +import { useRouter } from "next/navigation"; + +export default function LoginPage() { + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [error, setError] = useState(""); + const [loading, setLoading] = useState(false); + const router = useRouter(); + + const handleLogin = async (e: React.FormEvent) => { + e.preventDefault(); + setError(""); + setLoading(true); + + try { + // Basic validation + if (!email || !password) { + setError("Please enter email and password"); + setLoading(false); + return; + } + + // TODO: Replace with actual authentication logic + // For now, accept demo credentials + if (email === "admin@citycellworld.com" && password === "admin123") { + // Store authentication token or session + localStorage.setItem("adminToken", "authenticated"); + router.push("/admin"); + } else { + setError("Invalid email or password"); + } + } catch (err) { + setError("Login failed. Please try again."); + } finally { + setLoading(false); + } + }; + + return ( + + + +
+
+
+
+ +

Admin Login

+

Access the admin dashboard to manage prices and inventory

+
+ +
+ {error && ( +
+ {error} +
+ )} + +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ + +
+ +
+

+ Demo credentials: +

+

+ Email: admin@citycellworld.com +

+

+ Password: admin123 +

+
+
+
+
+ + +
+ ); +}