Skip to content

Commit 06e2c01

Browse files
committed
fix: nanofix
1 parent 50aa76f commit 06e2c01

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/components/QueriesActivityBar/QueriesActivityBar.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {chartApi} from '../MetricChart/reducer';
1616

1717
import {QueriesActivityCharts} from './QueriesActivityCharts';
1818
import i18n from './i18n';
19-
import {calculateLatency, calculateQueriesPerSecond} from './utils';
19+
import {calculateLatency, calculateQueriesPerSecond, formatTrendValue} from './utils';
2020

2121
import './QueriesActivityBar.scss';
2222

@@ -108,17 +108,6 @@ export function QueriesActivityBar({tenantName}: QueriesActivityBarProps) {
108108
history.push(path);
109109
};
110110

111-
// Helper to format trend display
112-
const formatTrendValue = (val: number) => {
113-
if (val >= 1) {
114-
return `+${val.toFixed(0)}`;
115-
} else if (val > 0) {
116-
return `+${val.toFixed(1)}`;
117-
} else {
118-
return val.toFixed(1);
119-
}
120-
};
121-
122111
return (
123112
<div className={b({expanded})}>
124113
<Disclosure expanded={expanded} onUpdate={setExpanded} className={b('disclosure')}>

src/components/QueriesActivityBar/utils.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,16 @@ export const calculateLatency = (data?: (number | null)[]): MetricCalculationRes
8686

8787
return {value: current.toFixed(1), trend};
8888
};
89+
90+
/**
91+
* Format trend value for display
92+
*/
93+
export const formatTrendValue = (val: number): string => {
94+
if (val >= 1) {
95+
return `+${val.toFixed(0)}`;
96+
} else if (val > 0) {
97+
return `+${val.toFixed(1)}`;
98+
} else {
99+
return val.toFixed(1);
100+
}
101+
};

0 commit comments

Comments
 (0)