/** * SpecialSchoolNote — the context note shown on special-school / PRU / AP * detail pages explaining why the mainstream England-average comparison is * dropped. Renders nothing for mainstream schools. * * The copy is type-aware: only genuine special schools have pupils with special * educational needs. Pupil referral units and alternative provision teach * pupils educated outside a mainstream setting (e.g. after exclusion, or for * medical reasons) who are not necessarily SEND — so their note says so rather * than mischaracterising them. Suppressing the England comparison is reasonable * for all three. */ import { isSpecialSchool } from '@/lib/utils'; import styles from './SpecialSchoolNote.module.css'; type SpecialKind = 'special' | 'pru' | 'ap'; function specialKind(schoolType: string | null | undefined): SpecialKind { const t = (schoolType ?? '').toLowerCase(); if (/pupil referral/.test(t)) return 'pru'; if (/alternative provision/.test(t)) return 'ap'; return 'special'; } export function SpecialSchoolNote({ school }: { school: { school_type?: string | null } }) { if (!isSpecialSchool(school)) return null; const kind = specialKind(school.school_type); return (