New compare page.

This commit is contained in:
Mike Cao 2025-08-23 22:21:25 -07:00
parent 08f9adaddf
commit 3f167e05ba
17 changed files with 151 additions and 127 deletions

View file

@ -1,4 +1,4 @@
import { useMemo } from 'react';
import { useEffect, useMemo } from 'react';
import { Icon, Row, Text } from '@umami/react-zen';
import { LinkButton } from '@/components/common/LinkButton';
import { LoadingPanel } from '@/components/common/LoadingPanel';
@ -15,6 +15,7 @@ export interface MetricsTableProps extends ListTableProps {
limit?: number;
showMore?: boolean;
params?: Record<string, any>;
onDataLoad?: (data: any) => void;
}
export function MetricsTable({
@ -24,6 +25,7 @@ export function MetricsTable({
limit,
showMore = false,
params,
onDataLoad,
...props
}: MetricsTableProps) {
const { updateParams } = useNavigation();
@ -55,6 +57,12 @@ export function MetricsTable({
return [];
}, [data, dataFilter, limit, type]);
useEffect(() => {
if (data) {
onDataLoad?.(data);
}
}, [data]);
const renderLabel = (row: any) => {
return <MetricLabel type={type} data={row} />;
};