-
Notifications
You must be signed in to change notification settings - Fork 0
/
PriorityComplexityDisplay.tsx
39 lines (36 loc) · 1.11 KB
/
PriorityComplexityDisplay.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { PriorityIcon } from "../icons/PriorityIcon";
import { ComplexityIcon } from "../icons/ComplexityIcon";
import { levelsCount } from "./LevelSelector";
type PriorityComplexityDisplayProps = {
priority?: number;
complexity?: number;
};
const priorityComplexityDesc = (desc: number) => {
if (desc < 4) return "Low";
if (desc < 7) return "Medium";
return "High";
};
export default function PriorityComplexityDisplay({
priority,
complexity,
}: PriorityComplexityDisplayProps) {
return (
<div className="flex gap-2">
{priority ? <PriorityIcon /> : <ComplexityIcon />}
<div className="flex gap-1">
<span className="text-sm text-gray-600">
{priority ? "Priority:" : "Complexity:"}{" "}
</span>
<span className="text-sm flex gap-1">
<span className="text-sm">
{priority && priorityComplexityDesc(priority)}
{complexity && priorityComplexityDesc(complexity)}
</span>
<span className="text-sm">
({priority || complexity}/{levelsCount})
</span>
</span>
</div>
</div>
);
}