feat: importance in db and mentorcard home colors
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user