/* Admin → Forms & Permissions: create e-sign forms, track completion. */ function FormsAdminScreen() { const [forms, setForms] = React.useState([ { id:1, title:'Museum Field Trip', type:'Trip', icon:'bus', tint:'var(--gold-100)', ic:'var(--gold-600)', signed:842, total:1248, due:'Jun 5', fee:'$15.00' }, { id:2, title:'Media Release', type:'Consent', icon:'camera', tint:'var(--info-100)', ic:'var(--info-500)', signed:1103, total:1248, due:'Jun 8', fee:null }, { id:3, title:'Technology Use Agreement', type:'Policy', icon:'laptop', tint:'var(--blue-100)', ic:'var(--blue-500)', signed:611, total:1248, due:'Jun 12', fee:null }, { id:4, title:'Emergency Contact Update', type:'Annual', icon:'phone', tint:'var(--success-100)', ic:'var(--success-500)', signed:1248, total:1248, due:'Closed', fee:null }, ]); const pct = (f) => Math.round((f.signed / f.total) * 100); const remind = (f) => jlToast('Reminder sent to ' + (f.total - f.signed) + ' families', { icon:'send' }); const totalSigned = forms.reduce((s,f)=>s+f.signed,0); const totalPossible = forms.reduce((s,f)=>s+f.total,0); const avg = Math.round((totalSigned/totalPossible)*100); const outstanding = forms.reduce((s,f)=>s+(f.total-f.signed),0); return (
jlToast('New form builder opened', { icon:'plus' })} style={{ display:'flex', alignItems:'center', gap:6, background:'var(--gold-400)', color:'var(--on-gold)', border:0, borderRadius:9, padding:'8px 13px', fontWeight:700, fontSize:12.5, cursor:'pointer', fontFamily:'var(--font-sans)', boxShadow:'var(--shadow-gold)' }}>New Form} pad={false}>
FormTypeCompletionDueAction
{forms.map((f,i) => { const p = pct(f), done = p >= 100; return (
{f.title}{f.fee && Fee {f.fee}} {f.type}
{p}%
{f.signed.toLocaleString()} of {f.total.toLocaleString()} signed
{f.due} {done ? Complete : }
); })}
); } Object.assign(window, { FormsAdminScreen });