47 lines
1.8 KiB
TypeScript
47 lines
1.8 KiB
TypeScript
/**
|
|
* InspectionNotice — the school page's inspection section when there is no
|
|
* Ofsted inspection record (audit H4): the inspectorate GIAS names (ISI), or
|
|
* Ofsted's own "not yet inspected" when its data lists the school. Nothing
|
|
* otherwise: no claim the data cannot support. Server component.
|
|
*/
|
|
|
|
import type { School } from '@/lib/types';
|
|
import { Section, sectionStyles as styles } from './sectionShared';
|
|
|
|
const OFSTED_REPORTS = 'https://reports.ofsted.gov.uk/inspection-reports/find-inspection-report/provider/ELS/';
|
|
const ISI_REPORTS = 'https://www.isi.net/reports/';
|
|
|
|
export function InspectionNotice({ school }: { school: Pick<School, 'urn' | 'inspectorate' | 'ofsted_listed'> }) {
|
|
if (school.inspectorate === 'ISI') {
|
|
return (
|
|
<Section id="ofsted">
|
|
<h2 className={styles.sectionTitle}>
|
|
Inspection
|
|
<a href={ISI_REPORTS} target="_blank" rel="noopener noreferrer" className={styles.ofstedReportLink}
|
|
data-umami-event="external_link_clicked" data-umami-event-target="isi">
|
|
ISI reports ↗
|
|
</a>
|
|
</h2>
|
|
<p className={styles.ofstedDisclaimer}>Inspected by the Independent Schools Inspectorate (ISI)</p>
|
|
</Section>
|
|
);
|
|
}
|
|
if (school.ofsted_listed) {
|
|
return (
|
|
<Section id="ofsted">
|
|
<h2 className={styles.sectionTitle}>
|
|
Ofsted Rating
|
|
<a href={`${OFSTED_REPORTS}${school.urn}`} target="_blank" rel="noopener noreferrer"
|
|
className={styles.ofstedReportLink} data-umami-event="external_link_clicked" data-umami-event-target="ofsted">
|
|
Ofsted reports ↗
|
|
</a>
|
|
</h2>
|
|
<div className={styles.ofstedHeader}>
|
|
<span className={styles.ofstedGrade}>Not yet inspected</span>
|
|
</div>
|
|
</Section>
|
|
);
|
|
}
|
|
return null;
|
|
}
|