import { SkillCategory, CategoryEvaluation, SkillLevel } from "@/lib/types"; import { SkillEvaluationCard } from "./skill-evaluation-card"; interface SkillEvaluationGridProps { currentCategory: SkillCategory; currentEvaluation: CategoryEvaluation; onUpdateSkill: (category: string, skillId: string, level: SkillLevel) => void; } export function SkillEvaluationGrid({ currentCategory, currentEvaluation, onUpdateSkill, }: SkillEvaluationGridProps) { const getSkillLevel = (skillId: string): SkillLevel => { const skillEval = currentEvaluation?.skills.find( (s) => s.skillId === skillId ); return skillEval?.level || null; }; if (!currentEvaluation.selectedSkillIds.length) { return null; } return (

{currentCategory.category}

{currentEvaluation.selectedSkillIds.length} compétence {currentEvaluation.selectedSkillIds.length > 1 ? "s" : ""}
{currentEvaluation.selectedSkillIds.map((skillId) => { const skill = currentCategory.skills.find((s) => s.id === skillId); if (!skill) return null; const currentLevel = getSkillLevel(skill.id); return ( onUpdateSkill(currentCategory.category, skillId, level) } /> ); })}
); }