/** * SecondaryAdmissionsSection — secondary pages. * * Not shared with the primary AdmissionsSection: the two were only 14% * similar. This one has no year/trend toggle, so it ships no client * JavaScript at all. Server component. */ import type { School, SchoolAdmissions, SchoolAdmissionDistance } from '@/lib/types'; import { formatPercentage } from '@/lib/utils'; import { Section, sectionStyles as styles } from './sectionShared'; import { describeCutoff, describeCutoffAbsence, CUTOFF_NOTE, CUTOFF_MEASUREMENT_NOTE, } from './lastDistanceOffered'; export function SecondaryAdmissionsSection({ admissions, admissionsHistory, admissionDistance, schoolInfo, hasSixthForm, }: { /* Nullable for the same reason as the primary section: a school can have a published cut-off and no EES admissions row. */ admissions: SchoolAdmissions | null; admissionsHistory: SchoolAdmissions[]; admissionDistance: SchoolAdmissionDistance | null; schoolInfo: School; hasSixthForm: boolean; }) { const cutoff = describeCutoff(admissionDistance); // Moved with this section from SecondarySchoolDetailView, its only consumer. const admissionsTag = (() => { const policy = schoolInfo.admissions_policy?.toLowerCase() ?? ''; if (policy.includes('selective')) return 'Selective'; const denom = schoolInfo.religious_denomination ?? ''; if (denom && denom !== 'Does not apply') return 'Faith priority'; return null; })(); return (

Admissions

{admissionsTag && (
{admissionsTag}{' '} {admissionsTag === 'Selective' ? '— Entry to this school is by selective examination (e.g. 11+).' : `— This school has a faith-based admissions priority (${schoolInfo.religious_denomination}).`}
)}
{admissions?.places_offered != null && (
Year 7 places offered
{admissions.places_offered}
)} {admissions?.total_applications != null && (
Total applications
{admissions.total_applications.toLocaleString()}
)} {admissions?.first_preference_applications != null && (
1st preference applications
{admissions.first_preference_applications.toLocaleString()}
)} {admissions?.first_preference_offer_pct != null && (
Families who got their first choice
{formatPercentage(admissions.first_preference_offer_pct)}
)} {cutoff && (
Last distance offered · {cutoff.entryYear}
{cutoff.primary}{' '} {cutoff.secondary}
)}
{admissions?.oversubscribed != null && (
{admissions.oversubscribed ? '⚠ Applications exceeded places last year' : '✓ Places were available last year'}
)} {/* Replaces a blanket "distance cut-off data is not available for this school", which was hardcoded onto every secondary page and was untrue wherever the local authority does publish. The absence is now stated only when it is real, and names the authority that would hold it. */} {cutoff ? (

{CUTOFF_NOTE} {CUTOFF_MEASUREMENT_NOTE} {cutoff.routeNote && <> {cutoff.routeNote}}

) : (

{describeCutoffAbsence({ localAuthority: schoolInfo.local_authority, admissionsPolicy: schoolInfo.admissions_policy, admissionsHistory, })}

)} {hasSixthForm && (
This school has a sixth form (Post-16 provision). Post-16 destination data coming soon.
)}
); }