diff --git a/src/components/tiles/CareerActivityTile.tsx b/src/components/tiles/CareerActivityTile.tsx index 28b28fd..9347a78 100644 --- a/src/components/tiles/CareerActivityTile.tsx +++ b/src/components/tiles/CareerActivityTile.tsx @@ -1,10 +1,8 @@ import React, { useState, useCallback } from 'react' -import { AnimatePresence, motion } from 'framer-motion' import { Card, CardHeader } from '../Card' import { documents } from '@/data/documents' import { consultations } from '@/data/consultations' - -const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches +import { useDetailPanel } from '@/contexts/DetailPanelContext' type ActivityType = 'role' | 'project' | 'cert' | 'edu' @@ -140,49 +138,46 @@ const dotColorMap: Record = { edu: '#7C3AED', } -const borderColorMap: Record = { - role: '#0D6E6E', - project: '#D97706', - cert: '#059669', - edu: '#7C3AED', -} - interface ActivityItemProps { entry: ActivityEntry - isExpanded: boolean - onToggle: () => void + onItemClick: () => void } -const ActivityItem: React.FC = ({ entry, isExpanded, onToggle }) => { +const ActivityItem: React.FC = ({ entry, onItemClick }) => { + const [isHovered, setIsHovered] = useState(false) const dotColor = dotColorMap[entry.type] - const isExpandable = entry.type === 'role' && entry.consultationId + const isClickable = entry.type === 'role' && entry.consultationId const handleKeyDown = useCallback( (e: React.KeyboardEvent) => { - if (!isExpandable) return + if (!isClickable) return if (e.key === 'Enter' || e.key === ' ') { e.preventDefault() - onToggle() - } else if (e.key === 'Escape' && isExpanded) { - e.preventDefault() - onToggle() + onItemClick() } }, - [isExpandable, isExpanded, onToggle], + [isClickable, onItemClick], ) - // Get consultation data for expanded content - const consultation = isExpandable + // Get consultation data for preview text + const consultation = isClickable ? consultations.find((c) => c.id === entry.consultationId) : null + // Get preview text (first 1-2 lines from examination) + const previewText = + consultation && consultation.examination.length > 0 + ? consultation.examination[0] + : null + return (
setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} style={{ display: 'flex', flexDirection: 'column', @@ -190,21 +185,13 @@ const ActivityItem: React.FC = ({ entry, isExpanded, onToggle borderRadius: 'var(--radius-sm)', border: '1px solid var(--border-light)', fontSize: '12px', - transition: 'border-color 0.15s', - cursor: isExpandable ? 'pointer' : 'default', - ...(isExpanded && { - borderColor: 'var(--accent-border)', - }), - }} - onMouseEnter={(e) => { - if (isExpandable) { - e.currentTarget.style.borderColor = 'var(--accent-border)' - } - }} - onMouseLeave={(e) => { - if (isExpandable && !isExpanded) { - e.currentTarget.style.borderColor = 'var(--border-light)' - } + transition: 'all 0.15s ease-out', + cursor: isClickable ? 'pointer' : 'default', + transform: isHovered && isClickable ? 'translateY(-1px)' : 'none', + boxShadow: isHovered && isClickable + ? '0 2px 8px rgba(26,43,42,0.08)' + : '0 1px 2px rgba(26,43,42,0.05)', + borderColor: isHovered && isClickable ? 'var(--accent-border)' : 'var(--border-light)', }} > {/* Item header row */} @@ -249,142 +236,76 @@ const ActivityItem: React.FC = ({ entry, isExpanded, onToggle > {entry.date}
- - - {/* Expanded content */} - - {isExpanded && consultation && ( - + {/* Hover preview text for roles */} + {isHovered && previewText && (
- {/* Role title */} -
- {consultation.role} -
- - {/* Achievement bullets */} - {consultation.examination.length > 0 && ( -
    - {consultation.examination.map((item, i) => ( -
  • - - • - - {item} -
  • - ))} -
- )} - - {/* Coded entries */} - {consultation.codedEntries && consultation.codedEntries.length > 0 && ( -
- {consultation.codedEntries.map((entry) => ( - - {entry.code} - - ))} -
- )} + {previewText}
-
- )} -
+ )} + + ) } export const CareerActivityTile: React.FC = () => { const timeline = buildTimeline() - const [expandedItemId, setExpandedItemId] = useState(null) + const { openPanel } = useDetailPanel() - const handleToggle = useCallback( - (id: string) => { - setExpandedItemId((prev) => (prev === id ? null : id)) + const handleItemClick = useCallback( + (entry: ActivityEntry) => { + if (entry.type === 'role' && entry.consultationId) { + const consultation = consultations.find((c) => c.id === entry.consultationId) + if (consultation) { + openPanel({ type: 'career-role', consultation }) + } + } }, - [], + [openPanel], ) return ( + {/* Placeholder for CareerConstellation component (to be added later) */} +
+ Career Constellation visualization (to be implemented) +
+
{timeline.map((entry) => ( handleToggle(entry.id)} + onItemClick={() => handleItemClick(entry)} /> ))}