File tree Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @hyperdx/app ' : patch
3
+ ---
4
+
5
+ style(ui): improve duration column representation
Original file line number Diff line number Diff line change @@ -27,8 +27,12 @@ import { useHotkeys } from 'react-hotkeys-hook';
27
27
type Row = Record < string , any > & { duration : number } ;
28
28
type AccessorFn = ( row : Row , column : string ) => any ;
29
29
30
+ const SPECIAL_VALUES = {
31
+ not_available : 'NULL' ,
32
+ } ;
30
33
const ACCESSOR_MAP : Record < string , AccessorFn > = {
31
- duration : row => ( row . duration >= 0 ? row . duration : 'N/A' ) ,
34
+ duration : row =>
35
+ row . duration >= 0 ? row . duration : SPECIAL_VALUES . not_available ,
32
36
default : ( row , column ) => row [ column ] ,
33
37
} ;
34
38
@@ -367,16 +371,18 @@ export const RawLogTable = memo(
367
371
...( displayedColumns . map ( column => ( {
368
372
accessorFn : curry ( retrieveColumnValue ) ( column ) , // Columns can contain '.' and will not work with accessorKey
369
373
header : column ,
370
- cell : info => (
371
- < span
372
- // role="button"
373
- // onClick={() =>
374
- // onPropertySearchClick(column, info.getValue<string>())
375
- // }
376
- >
377
- { info . getValue < string > ( ) }
378
- </ span >
379
- ) ,
374
+ cell : info => {
375
+ const value = info . getValue < string > ( ) ;
376
+ return (
377
+ < span
378
+ className = { cx ( {
379
+ 'text-muted' : value === SPECIAL_VALUES . not_available ,
380
+ } ) }
381
+ >
382
+ { value }
383
+ </ span >
384
+ ) ;
385
+ } ,
380
386
size : 150 ,
381
387
} ) ) as ColumnDef < any > [ ] ) ,
382
388
{
You can’t perform that action at this time.
0 commit comments