import { useState } from 'react'; export default function Login({ onLogin }) { const [username, setUsername] = useState('admin'); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [busy, setBusy] = useState(false); const submit = async (e) => { e.preventDefault(); setBusy(true); setError(''); try { await onLogin(username, password); } catch (err) { setError(err.message); } finally { setBusy(false); } }; return (

Dispatch Console

{error &&

{error}

}
); }