"use client" import type React from "react" import { useState } from "react" import { motion } from "framer-motion" import { useNavigate } from "react-router-dom" import { Eye, EyeOff, Lock, Mail } from "lucide-react" import { Link } from "react-router-dom"; export default function LoginPage() { const [email, setEmail] = useState("") const [password, setPassword] = useState("") const [showPassword, setShowPassword] = useState(false) const [isLoading, setIsLoading] = useState(false) const [error, setError] = useState("") const navigate = useNavigate() const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setError("") setIsLoading(true) // Simulate API call for authentication try { // In a real application, this would be an API call to your Laravel backend await new Promise((resolve) => setTimeout(resolve, 1500)) // For demo purposes, hardcoded check if (email === "admin@example.com" && password === "password") { // Store token in localStorage or cookies localStorage.setItem("adminToken", "demo-token-12345") navigate("/admin") } else { setError("Invalid email or password") } } catch (err) { setError("Authentication failed. Please try again.") } finally { setIsLoading(false) } } return (

Admin Access

Northern Territory Italian Migration History

{error && ( {error} )}
setEmail(e.target.value)} className="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-[#01796F] focus:border-[#01796F]" placeholder="admin@example.com" required />
setPassword(e.target.value)} className="block w-full pl-10 pr-10 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-[#01796F] focus:border-[#01796F]" placeholder="••••••••" required />
Forgot password?
{isLoading ? (
Signing in...
) : ( "Sign in" )}
or
Return to public site
© {new Date().getFullYear()} Northern Territory Italian Migration History Project
) }