refactor: rule of coverage are in one place
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
import { useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import {
|
||||
COVERAGE_OBJECTIVES,
|
||||
isCoverageBelowObjective,
|
||||
} from "@/lib/evaluation-utils";
|
||||
|
||||
interface SkillAnalysis {
|
||||
skillName: string;
|
||||
@@ -124,13 +128,11 @@ export function TeamSkillsTab({ skillAnalysis }: TeamSkillsTabProps) {
|
||||
</thead>
|
||||
<tbody>
|
||||
{filteredSkills.map((skill, idx) => {
|
||||
const target =
|
||||
skill.importance === "incontournable"
|
||||
? 75
|
||||
: skill.importance === "majeure"
|
||||
? 60
|
||||
: 0;
|
||||
const isUnderTarget = target > 0 && skill.coverage < target;
|
||||
const target = COVERAGE_OBJECTIVES[skill.importance];
|
||||
const isUnderTarget = isCoverageBelowObjective(
|
||||
skill.coverage,
|
||||
skill.importance
|
||||
);
|
||||
|
||||
return (
|
||||
<tr
|
||||
|
||||
Reference in New Issue
Block a user