import { ExternalLink, Info, X, UserCheck, GraduationCap } from "lucide-react"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; import { Skill, SkillLevel, SKILL_LEVELS, SkillEvaluation } from "@/lib/types"; import { TechIcon } from "@/components/icons/tech-icon"; interface SkillEvaluationCardProps { skill: Skill; skillEvaluation: SkillEvaluation; onUpdateSkill: (skillId: string, level: SkillLevel) => void; onUpdateMentorStatus: (skillId: string, canMentor: boolean) => void; onUpdateLearningStatus: (skillId: string, wantsToLearn: boolean) => void; onRemoveSkill: (skillId: string) => void; } function getLevelColor(level: Exclude) { switch (level) { case "never": return "bg-red-500"; case "not-autonomous": return "bg-amber-500"; case "autonomous": return "bg-green-500"; case "expert": return "bg-violet-500"; } } function getLevelColorBorder(level: Exclude) { switch (level) { case "never": return "border-red-500"; case "not-autonomous": return "border-amber-500"; case "autonomous": return "border-green-500"; case "expert": return "border-violet-500"; } } export function SkillEvaluationCard({ skill, skillEvaluation, onUpdateSkill, onUpdateMentorStatus, onUpdateLearningStatus, onRemoveSkill, }: SkillEvaluationCardProps) { const currentLevel = skillEvaluation.level; return (
{/* Skill Info */}

{skill.name}

{/* Info tooltip */}

{skill.description}

{skill.links.length > 0 && (

Liens utiles :

{skill.links.map((link, index) => ( {new URL(link).hostname} ))}
)}
{/* Level Selection */}
{Object.entries(SKILL_LEVELS).map(([value, label]) => { const isSelected = currentLevel === value; const levelValue = value as Exclude; return (
onUpdateSkill(skill.id, levelValue)} > {label}
); })} {/* Mentor and Learning Status Icons */}
{/* Mentor Icon */}

{skillEvaluation.canMentor ? "Peut mentorer" : "Peut mentorer"}

{/* Learning Icon */}

{skillEvaluation.wantsToLearn ? "Veut apprendre" : "J'aimerais apprendre"}

{/* Remove button */}

Supprimer cette technologie

); }