function ReportsAnalytics({ onNavigate }) { const [report, setReport] = React.useState('Institute'); const reports = ['Institute', 'Instructor', 'Trade-wise', 'Usage']; // Line chart data (weekly active learners, in thousands) const trend = [42, 48, 45, 58, 62, 71, 68, 78, 82, 88, 84, 92]; const maxT = Math.max(...trend); const w = 620, h = 180, pad = 10; const pts = trend.map((v, i) => [pad + (i * (w - 2 * pad)) / (trend.length - 1), h - pad - (v / maxT) * (h - 2 * pad)]); const linePath = pts.map((p, i) => `${i === 0 ? 'M' : 'L'} ${p[0].toFixed(1)} ${p[1].toFixed(1)}`).join(' '); const areaPath = `${linePath} L ${pts[pts.length - 1][0].toFixed(1)} ${h - pad} L ${pts[0][0].toFixed(1)} ${h - pad} Z`; const tradeBars = [ { t: 'COPA', v: 91 }, { t: 'Electrician', v: 84 }, { t: 'Fitter', v: 78 }, { t: 'Welder', v: 72 }, { t: 'Machinist', v: 68 }, { t: 'Diesel', v: 64 }, { t: 'Electronics', v: 61 }, { t: 'Solar', v: 55 }, ]; const rows = [ { name: 'Govt ITI Cuttack', instr: 42, students: 1240, comp: 82, aitt: 86, trend: 'up' }, { name: 'Govt ITI Pune', instr: 58, students: 1890, comp: 78, aitt: 81, trend: 'up' }, { name: 'Govt ITI Coimbatore', instr: 36, students: 1120, comp: 74, aitt: 77, trend: 'flat' }, { name: 'Govt ITI Lucknow', instr: 44, students: 1560, comp: 61, aitt: 64, trend: 'down' }, { name: 'Govt ITI Bengaluru', instr: 51, students: 1710, comp: 80, aitt: 83, trend: 'up' }, { name: 'Govt ITI Ahmedabad', instr: 33, students: 980, comp: 76, aitt: 79, trend: 'up' }, ]; return (
Reports & Analytics

Every metric, every level.

Drill from state to institute to instructor. Export detailed reports for DTET / NSDC review.

{/* Report type selector */}
{reports.map(r => ( ))}
{/* KPI row */}
{[ { k: '84,200', v: 'Active students', s: '↑ 3,120 (3.8%)', c: 'var(--green-600)' }, { k: '412', v: 'Institutes reporting', s: 'across 8 states', c: 'var(--ink-600)' }, { k: '78.4%', v: 'Avg. completion', s: '↑ 6.2% MoM', c: 'var(--green-600)' }, { k: '82%', v: 'AITT pass (pilot)', s: 'vs 61% baseline', c: 'var(--green-600)' }, ].map(s => (
{s.k}
{s.v}
{s.s}
))}
{/* Charts row */}
{/* Trend line chart */}
Active learners — 12-week trend
Thousands of students, weekly
↑ 24% growth
{[0.25, 0.5, 0.75, 1].map(g => ( ))} {pts.map((p, i) => )}
W1W4W8W12
{/* Trade-wise bars */}
Completion by trade
{tradeBars.map(t => (
{t.t}
= 80 ? 'var(--green-600)' : t.v >= 65 ? 'var(--saffron-500)' : 'var(--navy-600)', borderRadius: 4, display: 'flex', alignItems: 'center', justifyContent: 'end', paddingRight: 6 }}> {t.v}%
))}
{/* Detailed table */}
{report} report — top institutes
Ranked by completion & AITT pass rate
{rows.map(r => ( ))}
INSTITUTE INSTRUCTORS STUDENTS COMPLETION AITT PASS TREND
{r.name} {r.instr} {r.students.toLocaleString('en-IN')}
= 75 ? 'var(--green-600)' : r.comp >= 65 ? 'var(--saffron-500)' : 'var(--red-600)' }} />
{r.comp}%
{r.aitt}% {r.trend === 'up' ? '↑' : r.trend === 'down' ? '↓' : '→'}
Showing 6 of 412 institutes
); } window.ReportsAnalytics = ReportsAnalytics;