mirror of
https://github.com/umami-software/umami.git
synced 2026-02-24 22:45:36 +01:00
Unified loading states.
This commit is contained in:
parent
7b5591a3ce
commit
da8c7e99c5
52 changed files with 506 additions and 364 deletions
|
|
@ -35,7 +35,7 @@ export function Goal({ id, name, type, parameters, websiteId, startDate, endDate
|
|||
const isPage = parameters?.type === 'page';
|
||||
|
||||
return (
|
||||
<LoadingPanel isEmpty={!data} isLoading={isLoading} error={error}>
|
||||
<LoadingPanel data={data} isLoading={isLoading} error={error}>
|
||||
<Grid gap>
|
||||
<Grid columns="1fr auto" gap>
|
||||
<Column gap>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { LoadingPanel } from '@/components/common/LoadingPanel';
|
|||
import { Panel } from '@/components/common/Panel';
|
||||
|
||||
export function GoalsPage({ websiteId }: { websiteId: string }) {
|
||||
const { result } = useReportsQuery({ websiteId, type: 'goal' });
|
||||
const { result, query } = useReportsQuery({ websiteId, type: 'goal' });
|
||||
const {
|
||||
dateRange: { startDate, endDate },
|
||||
} = useDateRange(websiteId);
|
||||
|
|
@ -20,7 +20,7 @@ export function GoalsPage({ websiteId }: { websiteId: string }) {
|
|||
<SectionHeader>
|
||||
<GoalAddButton websiteId={websiteId} />
|
||||
</SectionHeader>
|
||||
<LoadingPanel isEmpty={!result?.data?.length} isLoading={!result}>
|
||||
<LoadingPanel data={result.data} isLoading={query.isLoading} error={query.error}>
|
||||
<Grid columns="1fr 1fr" gap>
|
||||
{result?.data?.map((report: any) => (
|
||||
<Panel key={report.id}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue