feat(members-time-sheet): enhance utilization display with color indicators

This commit is contained in:
shancds
2025-05-29 12:09:50 +05:30
parent 7b1c048dbb
commit f1920c17b4

View File

@@ -104,29 +104,20 @@ const MembersTimeSheet = forwardRef<MembersTimeSheetRef>((_, ref) => {
let color = '';
if (percent < 90) {
status = 'Under';
color = '🟧';
} else if (percent <= 110) {
status = 'Optimal';
color = '🟩';
} else {
status = 'Over';
color = '🟥';
}
return [
`${context.dataset.label}: ${hours} h`,
`Utilization: ${percent}%`,
`${color} Utilization: ${percent}%`,
`${status} Utilized: ${overUnder} h`
];
},
labelTextColor: function (context: any) {
const idx = context.dataIndex;
const member = jsonData[idx];
const utilization = parseFloat(member?.utilization_percent || '0');
if (utilization < 90) {
return '#FFB546';
} else if (utilization >= 90 && utilization <= 110) {
return '#B2EF9A';
} else {
return '#FE7173';
}
}
}
}
},