/* ═══════════════════════════════════════════════════════════════ ADMIN LOGIN Deliberately outside PageShell and the site nav. This isn't a page of the website; it's the door to the back office, and it shouldn't carry a banner, a subnav, or a footer site map. The Google button is stubbed and disabled until the OAuth routes exist. It's here so the layout doesn't change when it starts working. ═══════════════════════════════════════════════════════════════ */ import { useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; import { useAuth } from "../../lib/auth.tsx"; import { ApiError } from "../../lib/api.ts"; const GOOGLE_ENABLED = false; const fieldClass = "w-full rounded-xl border border-[#4a6b72]/25 bg-white px-4 py-3 text-[#26454c] " + "outline-none transition-colors focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25"; export default function AdminLogin() { const { login } = useAuth(); const navigate = useNavigate(); const location = useLocation(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(null); const [busy, setBusy] = useState(false); const destination = location.state?.from?.pathname ?? "/admin/home"; async function handleSubmit(event) { event.preventDefault(); if (busy) return; setBusy(true); setError(null); try { await login(email.trim(), password); navigate(destination, { replace: true }); } catch (err) { setError( err instanceof ApiError ? err.message : "Couldn't reach the server. Try again in a moment.", ); setPassword(""); setBusy(false); } } return (

NGU admin

Sign in to read and triage site feedback.

setEmail(e.target.value)} className={`mt-2 ${fieldClass}`} /> setPassword(e.target.value)} className={`mt-2 ${fieldClass}`} /> {error && (

{error}

)} {GOOGLE_ENABLED && ( <>
or
Continue with Google )}

Accounts are created on the server. Ask whoever runs the box.

); }