import { useState, type FormEvent } from 'react'; import { NotAdminError, useAuth } from '../auth/AuthContext'; export default function Login() { const { signIn } = useAuth(); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(null); const [busy, setBusy] = useState(false); async function handleSubmit(e: FormEvent) { e.preventDefault(); setError(null); setBusy(true); try { await signIn(email, password); } catch (err) { setError( err instanceof NotAdminError ? 'Geen toegang — alleen beheerders.' : 'Inloggen mislukt' ); } finally { setBusy(false); } } return (

SoleLog Admin

{error &&

{error}

}
); }