/** * SchoolRow Component * Three-line row for school search results * * Line 1: School name · School type * Line 2: R,W&M % · Progress score · Pupil count * Line 3: Local authority · Distance */ import type { School } from '@/lib/types'; import { formatPercentage, formatProgress, calculateTrend } from '@/lib/utils'; import { progressBand } from '@/lib/metrics'; import styles from './SchoolRow.module.css'; interface SchoolRowProps { school: School; isLocationSearch?: boolean; isInCompare?: boolean; onAddToCompare?: (school: School) => void; onRemoveFromCompare?: (urn: number) => void; } export function SchoolRow({ school, isLocationSearch, isInCompare = false, onAddToCompare, onRemoveFromCompare, }: SchoolRowProps) { const trend = calculateTrend(school.rwm_expected_pct, school.prev_rwm_expected_pct); // Use reading progress as representative; fall back to writing, then maths const progressScore = school.reading_progress ?? school.writing_progress ?? school.maths_progress ?? null; const handleCompareClick = () => { if (isInCompare) { onRemoveFromCompare?.(school.urn); } else { onAddToCompare?.(school); } }; return (