|
| 1 | +import { ResponsiveSuspense } from "responsive-rsc"; |
1 | 2 | import type { ThirdwebClient } from "thirdweb";
|
2 | 3 | import {
|
3 | 4 | getUniversalBridgeUsage,
|
4 | 5 | getUniversalBridgeWalletUsage,
|
5 | 6 | } from "@/api/analytics";
|
6 | 7 | import type { Range } from "@/components/analytics/date-range-selector";
|
7 | 8 | import { CodeServer } from "@/components/ui/code/code.server";
|
| 9 | +import { Skeleton } from "@/components/ui/skeleton"; |
8 | 10 | import { apiCode, embedCode, sdkCode } from "./code-examples";
|
| 11 | +import { PayAnalyticsFilter } from "./PayAnalyticsFilter"; |
9 | 12 | import { PayCustomersTable } from "./PayCustomersTable";
|
10 | 13 | import { PayEmbedFTUX } from "./PayEmbedFTUX";
|
11 | 14 | import { PaymentHistory } from "./PaymentHistory";
|
@@ -96,44 +99,70 @@ export async function PayAnalytics(props: {
|
96 | 99 | }
|
97 | 100 |
|
98 | 101 | return (
|
99 |
| - <div className="flex flex-col gap-10 lg:gap-6"> |
100 |
| - <GridWithSeparator> |
101 |
| - <div className="flex items-center border-border border-b pb-6 xl:border-none xl:pb-0"> |
102 |
| - <TotalVolumePieChart |
103 |
| - data={volumeData?.filter((x) => x.status === "completed") || []} |
104 |
| - /> |
105 |
| - </div> |
106 |
| - <TotalPayVolume |
107 |
| - data={volumeData?.filter((x) => x.status === "completed") || []} |
108 |
| - dateFormat={dateFormat} |
109 |
| - /> |
110 |
| - </GridWithSeparator> |
111 |
| - |
112 |
| - <div className="grid grid-cols-1 gap-6 xl:grid-cols-2"> |
113 |
| - <CardContainer> |
114 |
| - <Payouts |
115 |
| - data={volumeData?.filter((x) => x.status === "completed") || []} |
116 |
| - dateFormat={dateFormat} |
117 |
| - /> |
118 |
| - </CardContainer> |
119 |
| - <CardContainer> |
120 |
| - <PaymentsSuccessRate data={volumeData || []} /> |
121 |
| - </CardContainer> |
| 102 | + <div> |
| 103 | + <div className="mb-4 flex justify-start"> |
| 104 | + <PayAnalyticsFilter /> |
122 | 105 | </div>
|
| 106 | + <ResponsiveSuspense |
| 107 | + fallback={ |
| 108 | + <div className="flex flex-col gap-6"> |
| 109 | + <Skeleton className="h-[350px] border rounded-xl" /> |
| 110 | + <div className="grid grid-cols-1 gap-6 xl:grid-cols-2"> |
| 111 | + <Skeleton className="h-[350px] border rounded-xl" /> |
| 112 | + <Skeleton className="h-[350px] border rounded-xl" /> |
| 113 | + </div> |
| 114 | + <div className="grid grid-cols-1 gap-6 xl:grid-cols-2"> |
| 115 | + <Skeleton className="h-[350px] border rounded-xl" /> |
| 116 | + <Skeleton className="h-[350px] border rounded-xl" /> |
| 117 | + </div> |
| 118 | + <Skeleton className="h-[500px] border rounded-xl" /> |
| 119 | + </div> |
| 120 | + } |
| 121 | + searchParamsUsed={["from", "to", "interval"]} |
| 122 | + > |
| 123 | + <div className="flex flex-col gap-10 lg:gap-6"> |
| 124 | + <GridWithSeparator> |
| 125 | + <div className="flex items-center border-border border-b pb-6 xl:border-none xl:pb-0"> |
| 126 | + <TotalVolumePieChart |
| 127 | + data={volumeData?.filter((x) => x.status === "completed") || []} |
| 128 | + /> |
| 129 | + </div> |
| 130 | + <TotalPayVolume |
| 131 | + data={volumeData?.filter((x) => x.status === "completed") || []} |
| 132 | + dateFormat={dateFormat} |
| 133 | + /> |
| 134 | + </GridWithSeparator> |
123 | 135 |
|
124 |
| - <GridWithSeparator> |
125 |
| - <div className="border-border border-b pb-6 xl:border-none xl:pb-0"> |
126 |
| - <PayNewCustomers data={walletData || []} dateFormat={dateFormat} /> |
| 136 | + <div className="grid grid-cols-1 gap-6 xl:grid-cols-2"> |
| 137 | + <CardContainer> |
| 138 | + <Payouts |
| 139 | + data={volumeData?.filter((x) => x.status === "completed") || []} |
| 140 | + dateFormat={dateFormat} |
| 141 | + /> |
| 142 | + </CardContainer> |
| 143 | + <CardContainer> |
| 144 | + <PaymentsSuccessRate data={volumeData || []} /> |
| 145 | + </CardContainer> |
| 146 | + </div> |
| 147 | + |
| 148 | + <GridWithSeparator> |
| 149 | + <div className="border-border border-b pb-6 xl:border-none xl:pb-0"> |
| 150 | + <PayNewCustomers |
| 151 | + data={walletData || []} |
| 152 | + dateFormat={dateFormat} |
| 153 | + /> |
| 154 | + </div> |
| 155 | + <PayCustomersTable client={props.client} data={walletData || []} /> |
| 156 | + </GridWithSeparator> |
| 157 | + <CardContainer> |
| 158 | + <PaymentHistory |
| 159 | + client={props.client} |
| 160 | + projectClientId={props.projectClientId} |
| 161 | + teamId={props.teamId} |
| 162 | + /> |
| 163 | + </CardContainer> |
127 | 164 | </div>
|
128 |
| - <PayCustomersTable client={props.client} data={walletData || []} /> |
129 |
| - </GridWithSeparator> |
130 |
| - <CardContainer> |
131 |
| - <PaymentHistory |
132 |
| - client={props.client} |
133 |
| - projectClientId={props.projectClientId} |
134 |
| - teamId={props.teamId} |
135 |
| - /> |
136 |
| - </CardContainer> |
| 165 | + </ResponsiveSuspense> |
137 | 166 | </div>
|
138 | 167 | );
|
139 | 168 | }
|
|
0 commit comments