import { useState } from 'react' import { Card, CardHeader } from '../Card' import { useDetailPanel } from '@/contexts/DetailPanelContext' import { documents } from '@/data/documents' import { educationExtras } from '@/data/educationExtras' /** * Education tile - displays academic qualifications * Full-width card below Career Activity * Each entry is clickable to open detail panel */ export function EducationTile() { 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')!, ] // Look up education extras by document ID const getExtras = (docId: string) => educationExtras.find((e) => e.documentId === docId) // Build rich inline content for each entry const getInlineDetails = (doc: (typeof educationDocuments)[0]) => { const extras = getExtras(doc.id) switch (doc.id) { case 'doc-mpharm': return { title: 'MPharm (Hons) — 2:1', institution: 'University of East Anglia', year: '2011–2015', details: [ `Research project: Drug delivery & cocrystals, 75.1% (Distinction)`, ...(extras?.osceScore ? [`4th year OSCE: ${extras.osceScore}`] : []), ], } case 'doc-mary-seacole': return { title: 'NHS Leadership Academy — Mary Seacole Programme', institution: 'NHS Leadership Academy', year: '2018', details: [ `Programme score: 78%`, ...(extras?.programmeDetail ? [extras.programmeDetail] : []), ], } case 'doc-alevels': return { title: 'A-Levels', institution: 'Highworth Grammar School', year: '2009–2011', details: ['Mathematics (A*) · Chemistry (B) · Politics (C)'], } default: return { title: doc.title, institution: doc.institution, year: doc.date, details: doc.classification ? [doc.classification] : [], } } } return (
{educationDocuments.map((doc, index) => { const content = getInlineDetails(doc) const isHovered = hoveredIndex === index return ( ) })}
) }