mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-19 00:01:29 +08:00
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { PANEL_TYPES } from 'constants/queryBuilder';
|
|
import GridTableComponent from 'container/GridTableComponent';
|
|
import { GRID_TABLE_CONFIG } from 'container/GridTableComponent/config';
|
|
|
|
import { PanelWrapperProps } from './panelWrapper.types';
|
|
|
|
function TablePanelWrapper({
|
|
widget,
|
|
queryResponse,
|
|
tableProcessedDataRef,
|
|
searchTerm,
|
|
openTracesButton,
|
|
onOpenTraceBtnClick,
|
|
customOnRowClick,
|
|
}: PanelWrapperProps): JSX.Element {
|
|
const panelData =
|
|
(queryResponse.data?.payload?.data?.result?.[0] as any)?.table || [];
|
|
const { thresholds } = widget;
|
|
return (
|
|
<GridTableComponent
|
|
data={panelData}
|
|
query={widget.query}
|
|
thresholds={thresholds}
|
|
columnUnits={widget.columnUnits}
|
|
tableProcessedDataRef={tableProcessedDataRef}
|
|
sticky={widget.panelTypes === PANEL_TYPES.TABLE}
|
|
searchTerm={searchTerm}
|
|
openTracesButton={openTracesButton}
|
|
onOpenTraceBtnClick={onOpenTraceBtnClick}
|
|
customOnRowClick={customOnRowClick}
|
|
widgetId={widget.id}
|
|
renderColumnCell={widget.renderColumnCell}
|
|
customColTitles={widget.customColTitles}
|
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
{...GRID_TABLE_CONFIG}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default TablePanelWrapper;
|