/* Admin → Enrollment: applications pipeline & seat capacity. */ function EnrollmentScreen() { const [apps, setApps] = React.useState([ { id:1, n:'Aria Thompson', grade:'Grade 6', c:'blue', when:'Applied Jun 2', stage:'new' }, { id:2, n:'Marcus Bell', grade:'Grade 7', c:'gold', when:'Applied Jun 1', stage:'review' }, { id:3, n:'Lucia Moreno', grade:'Grade 6', c:'green', when:'Applied May 30', stage:'review' }, { id:4, n:'Owen Pierce', grade:'Grade 8', c:'navy', when:'Applied May 29', stage:'accepted' }, { id:5, n:'Zoe Nakamura', grade:'Grade 6', c:'red', when:'Applied May 27', stage:'waitlist' }, { id:6, n:'Eli Foster', grade:'Grade 7', c:'cyan', when:'Applied May 24', stage:'enrolled' }, ]); const STAGES = [ { id:'new', label:'New', bg:'var(--blue-100)', fg:'var(--blue-600)' }, { id:'review', label:'In Review', bg:'var(--warning-100)', fg:'var(--warning-600)' }, { id:'accepted', label:'Accepted', bg:'var(--info-100)', fg:'var(--info-500)' }, { id:'waitlist', label:'Waitlist', bg:'var(--gray-200)', fg:'var(--gray-600)' }, { id:'enrolled', label:'Enrolled', bg:'var(--success-100)', fg:'var(--success-600)' }, ]; const meta = (s) => STAGES.find(x=>x.id===s) || STAGES[0]; React.useEffect(() => { JLBackend.set('enroll', apps.map(a => ({ n:a.n, grade:a.grade, stage:a.stage, when:a.when }))); }, [apps]); const advance = (id) => { const order = ['new','review','accepted','enrolled']; setApps(a => a.map(x => { if (x.id!==id) return x; const i = order.indexOf(x.stage); return { ...x, stage: i>=0 && i apps.filter(a=>a.stage===s).length; const CAP = [ { g:'Grade 6', filled:412, cap:440 }, { g:'Grade 7', filled:398, cap:420 }, { g:'Grade 8', filled:438, cap:440 }, ]; return (
jlToast('New application form opened', { icon:'plus' })} style={{ display:'flex', alignItems:'center', gap:6, background:'var(--navy-600)', color:'#fff', border:0, borderRadius:9, padding:'8px 13px', fontWeight:700, fontSize:12.5, cursor:'pointer', fontFamily:'var(--font-sans)' }}>Add} pad={false}>
ApplicantGradeStageAction
{apps.map((a,i) => { const m = meta(a.stage); const canAdv = a.stage!=='enrolled' && a.stage!=='waitlist'; return (
w[0]).join('')} color={a.c} size={30} />{a.n}{a.when} {a.grade} {m.label} {canAdv ? : }
); })}
{CAP.map(c => { const pct = Math.round((c.filled/c.cap)*100); const full = pct>=100; return (
{c.g} {c.filled} / {c.cap}
=95?'var(--warning-500)':'var(--success-500)') }} />
{full?'At capacity':(c.cap-c.filled)+' seats open'}
); })}
); } Object.assign(window, { EnrollmentScreen });