@@ -13,7 +13,7 @@ import type {
1313} from '../../../../../store/reducers/tenants/utils' ;
1414import { cn } from '../../../../../utils/cn' ;
1515import { SHOW_NETWORK_UTILIZATION } from '../../../../../utils/constants' ;
16- import { useSetting , useTypedSelector } from '../../../../../utils/hooks' ;
16+ import { useSetting } from '../../../../../utils/hooks' ;
1717import { calculateMetricAggregates } from '../../../../../utils/metrics' ;
1818import {
1919 formatCoresLegend ,
@@ -38,7 +38,7 @@ interface MetricsTabsProps {
3838 networkStats ?: TenantMetricStats [ ] ;
3939 storageGroupsCount ?: number ;
4040 isServerless ?: boolean ;
41- activeTab ? : TenantMetricsTab ;
41+ activeTab : TenantMetricsTab ;
4242}
4343
4444export function MetricsTabs ( {
@@ -52,7 +52,6 @@ export function MetricsTabs({
5252 activeTab,
5353} : MetricsTabsProps ) {
5454 const location = useLocation ( ) ;
55- const { metricsTab} = useTypedSelector ( ( state ) => state . tenant ) ;
5655 const queryParams = parseQuery ( location ) ;
5756
5857 const tabLinks : Record < TenantMetricsTab , string > = {
@@ -99,14 +98,13 @@ export function MetricsTabs({
9998 [ networkStats ] ,
10099 ) ;
101100
102- const active = activeTab ?? metricsTab ;
103101 const cardVariant = isServerless ? 'serverless' : 'default' ;
104102
105103 return (
106104 < Flex className = { b ( { serverless : Boolean ( isServerless ) } ) } alignItems = "center" >
107105 < div
108106 className = { b ( 'link-container' , {
109- active : active === TENANT_METRICS_TABS_IDS . cpu ,
107+ active : activeTab === TENANT_METRICS_TABS_IDS . cpu ,
110108 } ) }
111109 >
112110 < Link to = { tabLinks . cpu } className = { b ( 'link' ) } >
@@ -115,7 +113,7 @@ export function MetricsTabs({
115113 value = { cpuMetrics . totalUsed }
116114 limit = { cpuMetrics . totalLimit }
117115 legendFormatter = { formatCoresLegend }
118- active = { active === TENANT_METRICS_TABS_IDS . cpu }
116+ active = { activeTab === TENANT_METRICS_TABS_IDS . cpu }
119117 helpText = { i18n ( 'context_cpu-description' ) }
120118 variant = { cardVariant }
121119 subtitle = { isServerless ? i18n ( 'serverless.autoscaled' ) : undefined }
@@ -124,7 +122,7 @@ export function MetricsTabs({
124122 </ div >
125123 < div
126124 className = { b ( 'link-container' , {
127- active : active === TENANT_METRICS_TABS_IDS . storage ,
125+ active : activeTab === TENANT_METRICS_TABS_IDS . storage ,
128126 } ) }
129127 >
130128 < Link to = { tabLinks . storage } className = { b ( 'link' ) } >
@@ -133,7 +131,7 @@ export function MetricsTabs({
133131 value = { storageMetrics . totalUsed }
134132 limit = { storageMetrics . totalLimit }
135133 legendFormatter = { formatStorageLegend }
136- active = { active === TENANT_METRICS_TABS_IDS . storage }
134+ active = { activeTab === TENANT_METRICS_TABS_IDS . storage }
137135 helpText = { i18n ( 'context_storage-description' ) }
138136 variant = { cardVariant }
139137 subtitle = {
@@ -154,7 +152,7 @@ export function MetricsTabs({
154152 < >
155153 < div
156154 className = { b ( 'link-container' , {
157- active : active === TENANT_METRICS_TABS_IDS . memory ,
155+ active : activeTab === TENANT_METRICS_TABS_IDS . memory ,
158156 } ) }
159157 >
160158 < Link to = { tabLinks . memory } className = { b ( 'link' ) } >
@@ -163,15 +161,15 @@ export function MetricsTabs({
163161 value = { memoryMetrics . totalUsed }
164162 limit = { memoryMetrics . totalLimit }
165163 legendFormatter = { formatStorageLegend }
166- active = { active === TENANT_METRICS_TABS_IDS . memory }
164+ active = { activeTab === TENANT_METRICS_TABS_IDS . memory }
167165 helpText = { i18n ( 'context_memory-description' ) }
168166 />
169167 </ Link >
170168 </ div >
171169 { showNetworkUtilization && networkStats && networkMetrics && (
172170 < div
173171 className = { b ( 'link-container' , {
174- active : active === TENANT_METRICS_TABS_IDS . network ,
172+ active : activeTab === TENANT_METRICS_TABS_IDS . network ,
175173 } ) }
176174 >
177175 < Link to = { tabLinks . network } className = { b ( 'link' ) } >
@@ -180,7 +178,7 @@ export function MetricsTabs({
180178 value = { networkMetrics . totalUsed }
181179 limit = { networkMetrics . totalLimit }
182180 legendFormatter = { formatSpeedLegend }
183- active = { active === TENANT_METRICS_TABS_IDS . network }
181+ active = { activeTab === TENANT_METRICS_TABS_IDS . network }
184182 helpText = { i18n ( 'context_network-description' ) }
185183 />
186184 </ Link >
0 commit comments