Skip to content

Commit eb542d5

Browse files
committed
fix: selfreview
1 parent f457e90 commit eb542d5

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/MemoryDetailsSection.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import i18n from '../../../../../components/MemoryViewer/i18n';
66
import {getMemorySegments} from '../../../../../components/MemoryViewer/utils';
77
import {ProgressWrapper} from '../../../../../components/ProgressWrapper';
88
import type {TMemoryStats} from '../../../../../types/api/nodes';
9-
import {formatBytes} from '../../../../../utils/bytesParsers';
109
import {cn} from '../../../../../utils/cn';
10+
import {formatStorageValuesToGb} from '../../../../../utils/dataFormatters/dataFormatters';
1111

1212
import {MemorySegmentItem} from './MemorySegmentItem';
1313

@@ -40,20 +40,7 @@ export function MemoryDetailsSection({memoryStats}: MemoryDetailsSectionProps) {
4040
}, [memorySegments]);
4141

4242
const formatValues = React.useCallback((value?: number, total?: number): [string, string] => {
43-
return [
44-
formatBytes({
45-
value: value || 0,
46-
size: 'gb',
47-
withSizeLabel: false,
48-
precision: 2,
49-
}),
50-
formatBytes({
51-
value: total || 0,
52-
size: 'gb',
53-
withSizeLabel: true,
54-
precision: 1,
55-
}),
56-
];
43+
return formatStorageValuesToGb(value, total) as [string, string];
5744
}, []);
5845

5946
return (

src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ export function TenantMemory({
4444
<ProgressWrapper
4545
value={memoryUsed}
4646
capacity={memoryLimit}
47-
formatValues={(value, total) => [
48-
formatStorageValuesToGb(Number(value))[0],
49-
formatStorageValuesToGb(Number(total))[0],
50-
]}
47+
formatValues={formatStorageValuesToGb}
5148
withCapacityUsage
5249
size="m"
5350
width="full"

0 commit comments

Comments
 (0)