/** * SchoolLifeSection — absence figures. Primary pages only; the secondary page * carries the equivalent content inside WellbeingSection. * * Server component. */ import type { AbsenceData } from '@/lib/types'; import { formatPercentage } from '@/lib/utils'; import { MetricTooltip } from '../MetricTooltip'; import { Section, sectionStyles as styles } from './sectionShared'; export function SchoolLifeSection({ absenceData, primaryAvg, }: { absenceData: AbsenceData | null; primaryAvg: Record; }) { return (

School Life

{absenceData?.overall_absence_rate != null && (
Days missed (overall absence)
{formatPercentage(absenceData.overall_absence_rate)}
{primaryAvg.overall_absence_pct != null && (
England avg: ~{primaryAvg.overall_absence_pct.toFixed(1)}%
)}
)} {absenceData?.persistent_absence_rate != null && (
Regularly missing school
{formatPercentage(absenceData.persistent_absence_rate)}
{primaryAvg.persistent_absence_pct != null && (
England avg: ~{primaryAvg.persistent_absence_pct.toFixed(0)}%
)}
)}
); }