/** * SecondaryHistorySection — results over time. Secondary pages. * Server component. */ import dynamic from 'next/dynamic'; import type { School, SchoolResult, NationalAverages } from '@/lib/types'; import { formatPercentage, formatProgress, formatAcademicYear } from '@/lib/utils'; import { Section, sectionStyles as styles } from './sectionShared'; const PerformanceChart = dynamic( () => import('../PerformanceChart').then((m) => m.PerformanceChart), { ssr: false }, ); export function SecondaryHistorySection({ yearlyData, schoolInfo, nationalAvg, secondaryAvg, suppressComparison, }: { yearlyData: SchoolResult[]; schoolInfo: School; nationalAvg: NationalAverages | null; secondaryAvg: Record; suppressComparison: boolean; }) { // National Attainment 8 baseline for the "Results Over Time" chart. const heroAtt8Nat = secondaryAvg.attainment_8_score ?? null; return (

Historical Results

{yearlyData.length > 0 && ( <>

Results Over Time

)}
View raw year-by-year data
{yearlyData.map((result) => ( ))}
Year Attainment 8 Progress 8 Eng & Maths 4+ EBacc entry %
{formatAcademicYear(result.year)} {result.attainment_8_score != null ? result.attainment_8_score.toFixed(1) : '-'} {result.progress_8_score != null ? formatProgress(result.progress_8_score) : '-'} {result.english_maths_standard_pass_pct != null ? formatPercentage(result.english_maths_standard_pass_pct) : '-'} {result.ebacc_entry_pct != null ? formatPercentage(result.ebacc_entry_pct) : '-'}
); }