/** * FinancesSection — shared between the primary and secondary detail pages * (the two versions were 91% identical). * * Server component. */ import type { SchoolFinance } from '@/lib/types'; import { formatAcademicYear } from '@/lib/utils'; import { Section, sectionStyles as styles } from './sectionShared'; export function FinancesSection({ finance, showPremises = false, }: { finance: SchoolFinance; /** * The secondary page shows a premises-cost card the primary page never had. * Gated rather than enabled everywhere so this refactor makes no visible * change; enabling it for primary is a one-line follow-up. */ showPremises?: boolean; }) { return (

School Finances ({formatAcademicYear(finance.year)})

Per-pupil spending shows how much the school has to spend on each child's education.

Total spend per pupil per year
£{Math.round(finance.per_pupil_spend!).toLocaleString()}
How much the school has to spend on each pupil annually
{finance.teacher_cost_pct != null && (
Share of budget spent on teachers
{finance.teacher_cost_pct.toFixed(1)}%
)} {finance.staff_cost_pct != null && (
Share of budget spent on all staff
{finance.staff_cost_pct.toFixed(1)}%
)} {showPremises && finance.premises_cost_pct != null && (
Share of budget spent on premises
{finance.premises_cost_pct.toFixed(1)}%
)}
); }