Skip to content

Commit 405bdb7

Browse files
committed
Quotas: do comparisions with constants instead of numbers
1 parent 9f3f8dd commit 405bdb7

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

frontend/src/components/pages/quotas/quotas-list.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ import { Alert, AlertIcon, Button, DataTable, Result, Skeleton } from '@redpanda
1414
import { SkipIcon } from 'components/icons';
1515
import { useMemo } from 'react';
1616

17-
import { type Quota_Value, Quota_ValueType } from '../../../protogen/redpanda/api/dataplane/v1/quota_pb';
17+
import {
18+
Quota_EntityType,
19+
type Quota_Value,
20+
Quota_ValueType,
21+
} from '../../../protogen/redpanda/api/dataplane/v1/quota_pb';
1822
import { listQuotas } from '../../../protogen/redpanda/api/dataplane/v1/quota-QuotaService_connectquery';
1923
import { InfoText } from '../../../utils/tsx-utils';
2024
import { prettyBytes, prettyNumber } from '../../../utils/utils';
@@ -35,11 +39,11 @@ const QuotasList = () => {
3539

3640
// Map entity type to display string
3741
let displayType: 'client-id' | 'user' | 'ip' | 'unknown' = 'unknown';
38-
if (entityType === 1) {
42+
if (entityType === Quota_EntityType.CLIENT_ID) {
3943
displayType = 'client-id';
40-
} else if (entityType === 3) {
44+
} else if (entityType === Quota_EntityType.USER) {
4145
displayType = 'user';
42-
} else if (entityType === 4) {
46+
} else if (entityType === Quota_EntityType.IP) {
4347
displayType = 'ip';
4448
}
4549

0 commit comments

Comments
 (0)