import React from 'react' import { ChevronRight } from 'lucide-react' import { CardHeader } from './Card' import { useDetailPanel } from '@/contexts/DetailPanelContext' import { timelineConsultations } from '@/data/timeline' import { hexToRgba } from '@/lib/utils' import { DEFAULT_ORG_COLOR } from '@/lib/theme-colors' interface LastConsultationCardProps { highlightedRoleId?: string | null } export function LastConsultationCard({ highlightedRoleId }: LastConsultationCardProps) { const { openPanel } = useDetailPanel() const consultation = timelineConsultations[0] if (!consultation) { return null } const isHighlighted = highlightedRoleId === consultation.id const handleOpenPanel = () => { openPanel({ type: 'consultation', consultation }) } const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault() handleOpenPanel() } } const formatDate = (dateStr: string): string => { const date = new Date(dateStr) return date.toLocaleDateString('en-GB', { month: 'long', year: 'numeric' }) } const getEmploymentType = (): string => { if (consultation.organization.includes('ICB')) { return 'Permanent · Full-time' } return 'Permanent' } const getBand = (): string => { if (consultation.role.includes('Head')) { return '8a' } return '—' } const fieldLabelStyle: React.CSSProperties = { fontSize: '12px', textTransform: 'uppercase', letterSpacing: '0.06em', color: 'var(--text-tertiary)', marginBottom: '3px', } const fieldValueStyle: React.CSSProperties = { fontSize: '13px', fontWeight: 600, color: 'var(--text-primary)', } return (