Skip to content

Commit 752888d

Browse files
authored
fix: use UsageLabel in top groups by usage table (#572)
1 parent 9200b11 commit 752888d

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

src/components/UsageLabel/UsageLabel.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import cn from 'bem-cn-lite';
22

33
import {Label, type LabelProps} from '@gravity-ui/uikit';
44

5+
import './UsageLabel.scss';
6+
57
const b = cn('ydb-usage-label');
68

79
interface UsageLabelProps extends LabelProps {

src/containers/Storage/StorageGroups/StorageGroups.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@
3131
width: 230px;
3232
}
3333

34-
&__usage-label {
35-
&_overload {
36-
color: var(--yc-color-text-light-primary);
37-
background-color: var(--yc-color-base-danger-heavy);
38-
}
39-
}
4034
&__group-id {
4135
font-weight: 500;
4236
}

src/containers/Storage/StorageGroups/getStorageGroupsColumns.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {stringifyVdiskId} from '../../../utils/dataFormatters/dataFormatters';
1313
import EntityStatus from '../../../components/EntityStatus/EntityStatus';
1414
import {Stack} from '../../../components/Stack/Stack';
1515
import {CellWithPopover} from '../../../components/CellWithPopover/CellWithPopover';
16+
import {UsageLabel} from '../../../components/UsageLabel/UsageLabel';
1617
import {VDisk} from '../VDisk';
1718
import {getDegradedSeverity, getUsageSeverityForStorageGroup} from '../utils';
1819
import i18n from './i18n';
@@ -128,12 +129,7 @@ const usageColumn: Column<PreparedStorageGroup> = {
128129
// without a limit the usage can be evaluated as 0,
129130
// but the absence of a value is more clear
130131
return row.Limit ? (
131-
<Label
132-
theme={getUsageSeverityForStorageGroup(row.Usage)}
133-
className={b('usage-label', {overload: row.Usage >= 90})}
134-
>
135-
{row.Usage}%
136-
</Label>
132+
<UsageLabel value={row.Usage} theme={getUsageSeverityForStorageGroup(row.Usage)} />
137133
) : (
138134
'-'
139135
);

0 commit comments

Comments
 (0)