feat: importance in db and mentorcard home colors

This commit is contained in:
Julien Froidefond
2025-08-27 11:51:43 +02:00
parent df1fd24e84
commit aee5d74445
13 changed files with 388 additions and 94 deletions

View File

@@ -12,6 +12,7 @@ import {
import { TreeCategoryHeader, TreeItemRow } from "@/components/admin";
import { TechIcon } from "@/components/icons/tech-icon";
import { Skill } from "@/clients/domains/admin-client";
import { ImportanceBadge } from "./importance-badge";
interface SkillsListProps {
filteredSkillsByCategory: Record<string, Skill[]>;
@@ -20,6 +21,7 @@ interface SkillsListProps {
onEditSkill: (skill: Skill) => void;
onDeleteSkill: (skillId: string) => void;
onDeleteCategory?: (categoryName: string) => void; // Nouvelle prop
onImportanceChange?: (skillId: string, newImportance: string) => void;
}
export function SkillsList({
@@ -29,6 +31,7 @@ export function SkillsList({
onEditSkill,
onDeleteSkill,
onDeleteCategory,
onImportanceChange,
}: SkillsListProps) {
// Fonction pour obtenir l'icône de la catégorie
const getCategoryIcon = (category: string) => {
@@ -108,6 +111,14 @@ export function SkillsList({
onDelete={() => onDeleteSkill(skill.id)}
canDelete={skill.usageCount === 0}
showSeparator={skillIndex > 0}
additionalInfo={
<ImportanceBadge
importance={skill.importance || "standard"}
onImportanceChange={(newImportance: string) =>
onImportanceChange?.(skill.id, newImportance)
}
/>
}
/>
))}
</div>