Fixed attribution report. New metric cards. Converted ListTable.

This commit is contained in:
Mike Cao
2025-06-11 00:05:34 -07:00
parent b2aa37a3df
commit 4995a0e1e4
19 changed files with 167 additions and 288 deletions

View File

@@ -1,24 +1,22 @@
import { ReactNode } from 'react';
import { Grid, Loading } from '@umami/react-zen';
import { ErrorMessage } from '@/components/common/ErrorMessage';
import { Grid } from '@umami/react-zen';
import { LoadingPanel } from '@/components/common/LoadingPanel';
export interface MetricsBarProps {
isLoading?: boolean;
isFetched?: boolean;
error?: unknown;
error?: Error;
children?: ReactNode;
}
export function MetricsBar({ children, isLoading, isFetched, error }: MetricsBarProps) {
return (
<>
{isLoading && !isFetched && <Loading icon="dots" />}
{error && <ErrorMessage />}
<LoadingPanel isLoading={isLoading} isFetched={isFetched} error={error}>
{!isLoading && !error && isFetched && (
<Grid columns="repeat(auto-fill, minmax(200px, 1fr))" width="100%" gapY="3">
<Grid columns="repeat(auto-fit, minmax(200px, 1fr))" width="100%" gap>
{children}
</Grid>
)}
</>
</LoadingPanel>
);
}