diff --git a/app/(stats)/analyze/content.tsx b/app/(stats)/analyze/content.tsx index 07037cec..3e827165 100644 --- a/app/(stats)/analyze/content.tsx +++ b/app/(stats)/analyze/content.tsx @@ -65,9 +65,16 @@ const create = setup([ upgrade, ]); +// Props +// --------------- +export interface ContentProps { + from: Date; + to?: Date; +} + // Component // --------------- -export const Content = async ({ from, to }: { from: Date; to?: Date }) => { +const AsyncContent = async ({ from, to }: ContentProps) => { const [squads, tournaments, count] = await Promise.all([ getSquads({ from, to }), getTournamentsCount({ from, to }), @@ -80,7 +87,7 @@ export const Content = async ({ from, to }: { from: Date; to?: Date }) => { }); return ( - }> + <>
@@ -119,6 +126,12 @@ export const Content = async ({ from, to }: { from: Date; to?: Date }) => {
-
+ ); }; + +export const Content = (props: ContentProps) => ( + }> + + +); diff --git a/app/(stats)/analyze/page.tsx b/app/(stats)/analyze/page.tsx index 9d97f5af..03f1f660 100644 --- a/app/(stats)/analyze/page.tsx +++ b/app/(stats)/analyze/page.tsx @@ -1,12 +1,13 @@ import { createMetadata } from '@/lib/metadata'; import { toDateRange } from '@/lib/utils/params.utils'; -import { Caption, Message, Title } from '@/ui'; +import { Caption, CardChartSkeleton, Message, Title } from '@/ui'; import { Filter } from '@/ui/params/filter'; import { DateRangeFilter } from '@/ui/params/date-range-filter'; import { StatsInfo } from '@/ui/stats/stats-info'; import { Content } from './content'; +import { Suspense } from 'react'; // Metadata // --------------- @@ -15,6 +16,17 @@ export const metadata = createMetadata({ description: 'Analyze the current X-Wing meta!', }); +// Helpers +// --------------- +const Loading = () => ( +
+ + + + +
+); + // Props // --------------- interface AnalyzePageProps { @@ -53,7 +65,9 @@ const AnalyzePage = async ({ searchParams }: AnalyzePageProps) => { - + }> + + ); };