@@ -16,7 +16,7 @@ import { Table, TableCellConfigs, TableColumnConfig } from '@perses-dev/componen
1616import { ReactElement , useEffect , useMemo , useState } from 'react' ;
1717import { formatValue , Labels , QueryDataType , TimeSeries , TimeSeriesData , transformData } from '@perses-dev/core' ;
1818import { PaginationState , SortingState , ColumnFiltersState } from '@tanstack/react-table' ;
19- import { useTheme , Theme } from '@mui/material' ;
19+ import { useTheme , Theme , Typography , Box } from '@mui/material' ;
2020import { ColumnSettings , TableOptions , evaluateConditionalFormatting } from '../models' ;
2121import { EmbeddedPanel } from './EmbeddedPanel' ;
2222
@@ -447,8 +447,23 @@ export function TablePanel({ contentDimensions, spec, queryResults }: TableProps
447447 return null ;
448448 }
449449
450+ if ( ! data ?. length ) {
451+ return (
452+ < Box
453+ sx = { {
454+ display : 'flex' ,
455+ justifyContent : 'center' ,
456+ alignItems : 'center' ,
457+ height : '100%' ,
458+ } }
459+ >
460+ < Typography > No data</ Typography >
461+ </ Box >
462+ ) ;
463+ }
464+
450465 return (
451- < div >
466+ < >
452467 { spec . enableFiltering && (
453468 < div
454469 style = { {
@@ -542,7 +557,6 @@ export function TablePanel({ contentDimensions, spec, queryResults }: TableProps
542557 } ) }
543558 </ div >
544559 ) }
545-
546560 < Table
547561 data = { filteredData }
548562 columns = { columns }
@@ -557,6 +571,6 @@ export function TablePanel({ contentDimensions, spec, queryResults }: TableProps
557571 pagination = { pagination }
558572 onPaginationChange = { setPagination }
559573 />
560- </ div >
574+ </ >
561575 ) ;
562576}
0 commit comments