mirror of
https://github.com/umami-software/umami.git
synced 2026-02-17 11:05:36 +01:00
Updated Goal loading.
This commit is contained in:
parent
f444c6373d
commit
96fcdefeed
1 changed files with 59 additions and 57 deletions
|
|
@ -24,7 +24,7 @@ export type GoalData = { num: number; total: number };
|
||||||
|
|
||||||
export function Goal({ id, name, type, parameters, websiteId, startDate, endDate }: GoalProps) {
|
export function Goal({ id, name, type, parameters, websiteId, startDate, endDate }: GoalProps) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { data, error, isLoading } = useResultQuery<GoalData>(type, {
|
const { data, error, isLoading, isFetching } = useResultQuery<GoalData>(type, {
|
||||||
websiteId,
|
websiteId,
|
||||||
dateRange: {
|
dateRange: {
|
||||||
startDate,
|
startDate,
|
||||||
|
|
@ -35,7 +35,8 @@ export function Goal({ id, name, type, parameters, websiteId, startDate, endDate
|
||||||
const isPage = parameters?.type === 'page';
|
const isPage = parameters?.type === 'page';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LoadingPanel data={data} isLoading={isLoading} error={error}>
|
<LoadingPanel data={data} isLoading={isLoading} isFetching={isFetching} error={error}>
|
||||||
|
{data && (
|
||||||
<Grid gap>
|
<Grid gap>
|
||||||
<Grid columns="1fr auto" gap>
|
<Grid columns="1fr auto" gap>
|
||||||
<Column gap>
|
<Column gap>
|
||||||
|
|
@ -93,6 +94,7 @@ export function Goal({ id, name, type, parameters, websiteId, startDate, endDate
|
||||||
</Text>
|
</Text>
|
||||||
</Row>
|
</Row>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
)}
|
||||||
</LoadingPanel>
|
</LoadingPanel>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue