feat(home): fetch national averages, wire to SchoolRow and CompactSchoolItem

- Add nationalAvgRwm state fetched from /api/national-averages on mount
- Pass nationalAvgRwm to SchoolRow (vs-national delta now active in list view)
- Pass nationalAvgRwm to SchoolMap (prop accepted, threaded to Task 7)
- Redesign CompactSchoolItem: Ofsted badge + single headline metric + delta
- Fix stray backslash in SchoolRow.module.css .vsNationalFlat selector

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tudor Sitaru
2026-04-13 14:17:34 +01:00
parent ad2fe5bbef
commit 2c13b21360
3 changed files with 74 additions and 19 deletions
+2 -1
View File
@@ -27,9 +27,10 @@ interface SchoolMapProps {
zoom?: number;
referencePoint?: [number, number];
onMarkerClick?: (school: School) => void;
nationalAvgRwm?: number | null;
}
export function SchoolMap({ schools, center, zoom = 13, referencePoint, onMarkerClick }: SchoolMapProps) {
export function SchoolMap({ schools, center, zoom = 13, referencePoint, onMarkerClick, nationalAvgRwm }: SchoolMapProps) {
const wrapperRef = useRef<HTMLDivElement>(null);
const [isFullscreen, setIsFullscreen] = useState(false);