@@ -14,7 +14,7 @@ import { Alert, AlertIcon, Button, DataTable, Result, Skeleton } from '@redpanda
1414import { SkipIcon } from 'components/icons' ;
1515import { useMemo } from 'react' ;
1616
17- import { Quota_ValueType } from '../../../protogen/redpanda/api/dataplane/v1/quota_pb' ;
17+ import { type Quota_Value , Quota_ValueType } from '../../../protogen/redpanda/api/dataplane/v1/quota_pb' ;
1818import { listQuotas } from '../../../protogen/redpanda/api/dataplane/v1/quota-QuotaService_connectquery' ;
1919import { InfoText } from '../../../utils/tsx-utils' ;
2020import { prettyBytes , prettyNumber } from '../../../utils/utils' ;
@@ -25,17 +25,23 @@ const QuotasList = () => {
2525 const { data, error, isLoading } = useQuery ( listQuotas , { } ) ;
2626
2727 const quotasData = useMemo ( ( ) => {
28- if ( ! data ?. quotas ) return [ ] ;
28+ if ( ! data ?. quotas ) {
29+ return [ ] ;
30+ }
2931
3032 return data . quotas . map ( ( entry ) => {
3133 const entityType = entry . entity ?. entityType ;
3234 const entityName = entry . entity ?. entityName ;
3335
3436 // Map entity type to display string
3537 let displayType : 'client-id' | 'user' | 'ip' | 'unknown' = 'unknown' ;
36- if ( entityType === 1 ) displayType = 'client-id' ;
37- else if ( entityType === 3 ) displayType = 'user' ;
38- else if ( entityType === 4 ) displayType = 'ip' ;
38+ if ( entityType === 1 ) {
39+ displayType = 'client-id' ;
40+ } else if ( entityType === 3 ) {
41+ displayType = 'user' ;
42+ } else if ( entityType === 4 ) {
43+ displayType = 'ip' ;
44+ }
3945
4046 return {
4147 eqKey : `${ entityType } -${ entityName } ` ,
@@ -57,7 +63,7 @@ const QuotasList = () => {
5763 ) ;
5864 } ;
5965
60- const formatRate = ( values : ( typeof quotasData ) [ 0 ] [ 'values' ] , valueType : Quota_ValueType ) => {
66+ const formatRate = ( values : Quota_Value [ ] , valueType : Quota_ValueType ) => {
6167 const value = values . find ( ( v ) => v . valueType === valueType ) ?. value ;
6268 return value ? (
6369 prettyNumber ( value )
@@ -125,7 +131,7 @@ const QuotasList = () => {
125131 eqKey : string ;
126132 entityType : 'client-id' | 'user' | 'ip' | 'unknown' ;
127133 entityName ?: string | undefined ;
128- values : Array < { valueType : Quota_ValueType ; value : number } > ;
134+ values : Quota_Value [ ] ;
129135 } >
130136 columns = { [
131137 {
0 commit comments