import React from 'react' import type { LucideIcon } from 'lucide-react' import { BarChart3, Code2, Database, PieChart, FileCode2, Sheet, GitBranch, Workflow, Pill, Users, FileCheck, TrendingUp, Route, ShieldAlert, Banknote, Handshake, MessageSquare, UserPlus, RefreshCw, Calculator, Presentation, ChevronRight, } from 'lucide-react' import { Card, CardHeader } from '../Card' import { skills } from '@/data/skills' import { useDetailPanel } from '@/contexts/DetailPanelContext' import type { SkillMedication, SkillCategory } from '@/types/pmr' const iconMap: Record = { BarChart3, Code2, Database, PieChart, FileCode2, Sheet, GitBranch, Workflow, Pill, Users, FileCheck, TrendingUp, Route, ShieldAlert, Banknote, Handshake, MessageSquare, UserPlus, RefreshCw, Calculator, Presentation, } const SKILLS_PER_CATEGORY = 4 const categoryConfig: { id: SkillCategory; label: string }[] = [ { id: 'Technical', label: 'Technical' }, { id: 'Domain', label: 'Healthcare Domain' }, { id: 'Leadership', label: 'Strategic & Leadership' }, ] interface SkillRowProps { skill: SkillMedication onClick: () => void } function SkillRow({ skill, onClick }: SkillRowProps) { const IconComponent = iconMap[skill.icon] const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault() onClick() } } return (
{ e.currentTarget.style.borderColor = 'var(--accent-border)' e.currentTarget.style.boxShadow = 'var(--shadow-md)' }} onMouseLeave={(e) => { e.currentTarget.style.borderColor = 'var(--border-light)' e.currentTarget.style.boxShadow = 'none' }} > {/* Icon */}
{IconComponent && }
{/* Text */}
{skill.name}
{skill.frequency} · {skill.yearsOfExperience} yrs
{/* Status badge */}
{skill.status}
{/* Chevron */}
) } interface CategorySectionProps { label: string categoryId: SkillCategory skills: SkillMedication[] onSkillClick: (skill: SkillMedication) => void onViewAll: (category: SkillCategory) => void isFirst: boolean } function CategorySection({ label, categoryId, skills: categorySkills, onSkillClick, onViewAll, isFirst, }: CategorySectionProps) { const visibleSkills = categorySkills.slice(0, SKILLS_PER_CATEGORY) const remainingCount = categorySkills.length - SKILLS_PER_CATEGORY return (
{/* Category header — sidebar section divider style */}
{label}
{categorySkills.length} items
{/* Skill rows */}
{visibleSkills.map((skill) => ( onSkillClick(skill)} /> ))}
{/* View all button */} {remainingCount > 0 && ( )}
) } export function CoreSkillsTile() { const { openPanel } = useDetailPanel() // Group skills by category, sorted by proficiency descending const groupedSkills = categoryConfig.map(({ id, label }) => ({ id, label, skills: skills .filter((s) => s.category === id) .sort((a, b) => b.proficiency - a.proficiency), })) const handleSkillClick = (skill: SkillMedication) => { openPanel({ type: 'skill', skill }) } const handleViewAll = (category: SkillCategory) => { openPanel({ type: 'skills-all', category }) } return ( {groupedSkills.map((group, index) => ( ))} ) }