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 (
Drill from state to institute to instructor. Export detailed reports for DTET / NSDC review.
| 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' ? '↓' : '→'} |