Skip to content

Commit

Permalink
Fix TPS
Browse files Browse the repository at this point in the history
  • Loading branch information
juberti committed Apr 22, 2024
1 parent 3630eb6 commit 2699e7b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions website/src/components/DataGrid.astro
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@ Astro.response.headers.set('Cache-Control', 'no-cache');
};
const def = map[currentColumnID];
if (def) {
if (params.value <= def.bestPerformance) {
return {backgroundColor: style.getPropertyValue('--good-color')};
} else if (params.value >= def.worstPerformance) {
return {backgroundColor: style.getPropertyValue('--bad-color')};
const isGood = def.worstPerformance > def.bestPerformance ?
params.value < def.bestPerformance : params.value > def.bestPerformance;
const isBad = def.worstPerformance > def.bestPerformance ?
params.value > def.worstPerformance : params.value < def.worstPerformance;
if (isGood) {
return { backgroundColor: style.getPropertyValue('--good-color') };
} else if (isBad) {
return { backgroundColor: style.getPropertyValue('--bad-color') };
}
}
return {};
Expand Down

0 comments on commit 2699e7b

Please sign in to comment.