diff --git a/src/components/tiles/EducationTile.tsx b/src/components/tiles/EducationTile.tsx index 2690c07..000d411 100644 --- a/src/components/tiles/EducationTile.tsx +++ b/src/components/tiles/EducationTile.tsx @@ -1,63 +1,134 @@ +import { useState } from 'react' import { Card, CardHeader } from '../Card' +import { useDetailPanel } from '@/contexts/DetailPanelContext' +import { documents } from '@/data/documents' /** * Education tile - displays academic qualifications * Full-width card below Career Activity + * Each entry is clickable to open detail panel */ export function EducationTile() { - // Education entries from CV, presented in reverse chronological order - const educationEntries = [ - { - degree: 'MPharm (Hons) — 2:1', - detail: 'University of East Anglia · 2015', - }, - { - degree: 'NHS Leadership Academy — Mary Seacole Programme', - detail: '2018 · 78%', - }, - { - degree: 'A-Levels: Mathematics (A*), Chemistry (B), Politics (C)', - detail: 'Highworth Grammar School · 2009–2011', - }, + const { openPanel } = useDetailPanel() + const [hoveredIndex, setHoveredIndex] = useState(null) + + // Filter to main education entries in reverse chronological order + const educationDocuments = [ + documents.find((d) => d.id === 'doc-mary-seacole')!, + documents.find((d) => d.id === 'doc-mpharm')!, + documents.find((d) => d.id === 'doc-alevels')!, ] + // Build rich inline content for each entry + const getInlineContent = (doc: typeof educationDocuments[0]) => { + switch (doc.id) { + case 'doc-mpharm': + return { + title: 'MPharm (Hons) — 2:1', + institution: 'University of East Anglia', + year: '2015', + extra: 'Research project: 75.1% (Distinction)', + } + case 'doc-mary-seacole': + return { + title: 'NHS Leadership Academy — Mary Seacole Programme', + institution: 'NHS Leadership Academy', + year: '2018', + extra: 'Programme score: 78%', + } + case 'doc-alevels': + return { + title: 'A-Levels', + institution: 'Highworth Grammar School', + year: '2009–2011', + extra: 'Mathematics A* · Chemistry B · Politics C', + } + default: + return { + title: doc.title, + institution: doc.institution, + year: doc.date, + extra: doc.classification, + } + } + } + return (
- {educationEntries.map((entry, index) => ( -
- { + const content = getInlineContent(doc) + const isHovered = hoveredIndex === index + + return ( +
- ))} +
+ + {content.title} + + + {content.year} + +
+
+ {content.institution} +
+ {content.extra && ( +
+ {content.extra} +
+ )} + + ) + })}
)