import { useState, useEffect } from 'react' import { api } from './api' import styles from './Platform.module.css' // A. Entry screen — RootNode Academy branding, choose your name from roster, no password. // Explicitly pilot/dev identity, not production auth — see // docs/PHASE2A_GATEWAY_AND_STUDENT_FLOW.md "Student identity limitation." export default function EntryScreen({ onLogin }) { const [cohorts, setCohorts] = useState([]) const [cohort, setCohort] = useState('') const [roster, setRoster] = useState([]) const [studentId, setStudentId] = useState('') const [loading, setLoading] = useState(false) const [error, setError] = useState(null) useEffect(() => { api.cohorts().then(setCohorts).catch((e) => setError(e.message)) }, []) useEffect(() => { if (!cohort) { setRoster([]); return } api.roster(cohort).then(setRoster).catch((e) => setError(e.message)) }, [cohort]) const handleLogin = async () => { if (!studentId) return setLoading(true) setError(null) try { const student = await api.login(studentId) onLogin(student) } catch (e) { setError(e.message) } finally { setLoading(false) } } return (
⎈ RootNode Academy

Real-world Kubernetes labs. Pick your name to continue.

Pilot identity — no password. Not production auth.

{error &&
{error}
} {cohort && ( <> )}
) }