@@ -126,52 +126,67 @@ export const QueryPerformance = ({
126
126
} }
127
127
>
128
128
< TabsList_Shadcn_ className = { cn ( 'flex gap-0 border-0 items-end z-10' ) } >
129
- { QUERY_PERFORMANCE_TABS . map ( ( tab ) => (
130
- < TabsTrigger_Shadcn_
131
- key = { tab . id }
132
- value = { tab . id }
133
- className = { cn (
134
- 'group relative' ,
135
- 'px-6 py-3 border-b-0 flex flex-col items-start !shadow-none border-default border-t' ,
136
- 'even:border-x last:border-r even:!border-x-strong last:!border-r-strong' ,
137
- tab . id === page ? '!bg-surface-200' : '!bg-surface-200/[33%]' ,
138
- 'hover:!bg-surface-100' ,
139
- 'data-[state=active]:!bg-surface-200' ,
140
- 'hover:text-foreground-light' ,
141
- 'transition'
142
- ) }
143
- >
144
- { tab . id === page && (
145
- < div className = "absolute top-0 left-0 w-full h-[1px] bg-foreground" />
146
- ) }
129
+ { QUERY_PERFORMANCE_TABS . map ( ( tab ) => {
130
+ const tabMax = Number ( tab . max )
131
+ const maxValue =
132
+ tab . id !== QUERY_PERFORMANCE_REPORT_TYPES . MOST_FREQUENT
133
+ ? tabMax > 1000
134
+ ? ( tabMax / 1000 ) . toFixed ( 2 )
135
+ : tabMax . toLocaleString ( )
136
+ : tabMax . toLocaleString ( )
147
137
148
- < div className = "flex items-center gap-x-2" >
149
- < span className = "" > { tab . label } </ span >
150
- < Tooltip_Shadcn_ >
151
- < TooltipTrigger_Shadcn_ asChild >
152
- < InformationCircleIcon className = "transition text-foreground-muted w-3 h-3 data-[state=delayed-open]:text-foreground-light" />
153
- </ TooltipTrigger_Shadcn_ >
154
- < TooltipContent_Shadcn_ side = "top" > { tab . description } </ TooltipContent_Shadcn_ >
155
- </ Tooltip_Shadcn_ >
156
- </ div >
157
- { tab . isLoading ? (
158
- < ShimmeringLoader className = "w-32 pt-1" />
159
- ) : tab . max === undefined ? (
160
- < span className = "text-xs text-foreground-muted group-hover:text-foreground-lighter group-data-[state=active]:text-foreground-lighter transition" >
161
- No data yet
162
- </ span >
163
- ) : (
164
- < span className = "text-xs text-foreground-muted group-hover:text-foreground-lighter group-data-[state=active]:text-foreground-lighter transition" >
165
- { Number ( tab . max ) . toLocaleString ( ) }
166
- { tab . id !== QUERY_PERFORMANCE_REPORT_TYPES . MOST_FREQUENT ? 'ms' : ' calls' }
167
- </ span >
168
- ) }
138
+ return (
139
+ < TabsTrigger_Shadcn_
140
+ key = { tab . id }
141
+ value = { tab . id }
142
+ className = { cn (
143
+ 'group relative' ,
144
+ 'px-6 py-3 border-b-0 flex flex-col items-start !shadow-none border-default border-t' ,
145
+ 'even:border-x last:border-r even:!border-x-strong last:!border-r-strong' ,
146
+ tab . id === page ? '!bg-surface-200' : '!bg-surface-200/[33%]' ,
147
+ 'hover:!bg-surface-100' ,
148
+ 'data-[state=active]:!bg-surface-200' ,
149
+ 'hover:text-foreground-light' ,
150
+ 'transition'
151
+ ) }
152
+ >
153
+ { tab . id === page && (
154
+ < div className = "absolute top-0 left-0 w-full h-[1px] bg-foreground" />
155
+ ) }
169
156
170
- { tab . id === page && (
171
- < div className = "absolute bottom-0 left-0 w-full h-[1px] bg-surface-200" > </ div >
172
- ) }
173
- </ TabsTrigger_Shadcn_ >
174
- ) ) }
157
+ < div className = "flex items-center gap-x-2" >
158
+ < span className = "" > { tab . label } </ span >
159
+ < Tooltip_Shadcn_ >
160
+ < TooltipTrigger_Shadcn_ asChild >
161
+ < InformationCircleIcon className = "transition text-foreground-muted w-3 h-3 data-[state=delayed-open]:text-foreground-light" />
162
+ </ TooltipTrigger_Shadcn_ >
163
+ < TooltipContent_Shadcn_ side = "top" > { tab . description } </ TooltipContent_Shadcn_ >
164
+ </ Tooltip_Shadcn_ >
165
+ </ div >
166
+ { tab . isLoading ? (
167
+ < ShimmeringLoader className = "w-32 pt-1" />
168
+ ) : tab . max === undefined ? (
169
+ < span className = "text-xs text-foreground-muted group-hover:text-foreground-lighter group-data-[state=active]:text-foreground-lighter transition" >
170
+ No data yet
171
+ </ span >
172
+ ) : (
173
+ < span className = "text-xs text-foreground-muted group-hover:text-foreground-lighter group-data-[state=active]:text-foreground-lighter transition" >
174
+ { /* {Number(tab.max).toLocaleString()} */ }
175
+ { maxValue }
176
+ { tab . id !== QUERY_PERFORMANCE_REPORT_TYPES . MOST_FREQUENT
177
+ ? tabMax > 1000
178
+ ? 's'
179
+ : 'ms'
180
+ : ' calls' }
181
+ </ span >
182
+ ) }
183
+
184
+ { tab . id === page && (
185
+ < div className = "absolute bottom-0 left-0 w-full h-[1px] bg-surface-200" > </ div >
186
+ ) }
187
+ </ TabsTrigger_Shadcn_ >
188
+ )
189
+ } ) }
175
190
</ TabsList_Shadcn_ >
176
191
</ Tabs_Shadcn_ >
177
192
0 commit comments