Cleanups in DataTable code

Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
Julius Volz 2024-03-08 17:43:38 +01:00
parent b17dae1dab
commit 9093e0ab91

View file

@ -22,23 +22,13 @@ const limitSeries = <S extends InstantSample | RangeSamples>(
return series;
};
export interface TableProps {
export interface DataTableProps {
expr: string;
evalTime: number | null;
retriggerIdx: number;
}
const DataTable: FC<TableProps> = ({ expr, evalTime, retriggerIdx }) => {
// const now = useMemo(() => Date.now() / 1000, [retriggerIdx]);
// const { data, error, isFetching, isLoading } = useInstantQueryQuery(
// {
// query: expr,
// time: evalTime !== null ? evalTime / 1000 : now,
// },
// { skip: !expr }
// );
// const now = useMemo(() => Date.now() / 1000, [retriggerIdx]);
const DataTable: FC<DataTableProps> = ({ expr, evalTime, retriggerIdx }) => {
const { data, error, isFetching, isLoading, refetch } =
useAPIQuery<InstantQueryResult>({
key: useId(),
@ -85,11 +75,7 @@ const DataTable: FC<TableProps> = ({ expr, evalTime, retriggerIdx }) => {
if (result.length === 0) {
return (
<Alert
// color="light"
title="Empty query result"
icon={<IconInfoCircle size={14} />}
>
<Alert title="Empty query result" icon={<IconInfoCircle size={14} />}>
This query returned no data.
</Alert>
);