File tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed
packages/compass-explain-plan/src/components/explain-tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,12 @@ const shardViewTextStyles = css({
211
211
whiteSpace : 'nowrap' ,
212
212
} ) ;
213
213
214
+ const overflowTextStyles = css ( {
215
+ overflow : 'hidden' ,
216
+ textOverflow : 'ellipsis' ,
217
+ whiteSpace : 'nowrap' ,
218
+ } ) ;
219
+
214
220
const StatsBadge : React . FunctionComponent < {
215
221
stats : number | string ;
216
222
} > = ( { stats } ) => {
@@ -237,18 +243,29 @@ const ShardView: React.FunctionComponent<ShardViewProps> = (props) => {
237
243
) ;
238
244
} ;
239
245
246
+ const Highlight : React . FunctionComponent < {
247
+ value : string ;
248
+ field : string ;
249
+ } > = ( { field, value } ) => {
250
+ return (
251
+ < li className = { overflowTextStyles } >
252
+ < span > { field } : </ span >
253
+ < strong title = { value } > { value } </ strong >
254
+ </ li >
255
+ ) ;
256
+ } ;
257
+
240
258
const Highlights : React . FunctionComponent < {
241
259
highlights : Record < string , boolean | string > ;
242
260
} > = ( { highlights } ) => {
243
261
return (
244
262
< ul >
245
263
{ Object . entries ( highlights ) . map ( ( [ key , value ] , index ) => (
246
- < li key = { index } >
247
- < span > { key } : </ span >
248
- < strong >
249
- { typeof value === 'boolean' ? ( value ? 'yes' : 'no' ) : value }
250
- </ strong >
251
- </ li >
264
+ < Highlight
265
+ key = { index }
266
+ field = { key }
267
+ value = { typeof value === 'boolean' ? ( value ? 'yes' : 'no' ) : value }
268
+ />
252
269
) ) }
253
270
</ ul >
254
271
) ;
You can’t perform that action at this time.
0 commit comments