diff --git a/nextjs-app/components/SecondarySchoolRow.tsx b/nextjs-app/components/SecondarySchoolRow.tsx index 9debdc6..5ec8f08 100644 --- a/nextjs-app/components/SecondarySchoolRow.tsx +++ b/nextjs-app/components/SecondarySchoolRow.tsx @@ -11,16 +11,9 @@ 'use client'; import type { School } from '@/lib/types'; -import { getPhaseStyle, schoolUrl } from '@/lib/utils'; +import { buildOfstedListBadge, getPhaseStyle, schoolUrl } from '@/lib/utils'; import styles from './SecondarySchoolRow.module.css'; -const OFSTED_LABELS: Record = { - 1: 'Outstanding', - 2: 'Good', - 3: 'Req. Improvement', - 4: 'Inadequate', -}; - function detectAdmissionsTag(school: School): string | null { const policy = school.admissions_policy?.toLowerCase() ?? ''; if (policy.includes('selective')) return 'Selective'; @@ -58,6 +51,7 @@ export function SecondarySchoolRow({ } }; + const ofstedBadge = buildOfstedListBadge(school); const phase = getPhaseStyle(school.phase); const att8 = school.attainment_8_score ?? null; const laDelta = @@ -77,16 +71,9 @@ export function SecondarySchoolRow({ {school.school_name} - {school.ofsted_grade && ( - - {OFSTED_LABELS[school.ofsted_grade]} - {school.ofsted_date && ( - - {' '}({new Date(school.ofsted_date).getFullYear()}) - - )} - - )} + + {ofstedBadge.label} + {/* Line 2: Context tags */} @@ -126,15 +113,6 @@ export function SecondarySchoolRow({ )} - {school.english_maths_standard_pass_pct != null && ( - - - {school.english_maths_standard_pass_pct.toFixed(0)}% - - Eng & Maths 4+ - - )} - {school.total_pupils != null && (