-
-
@@ -45,3 +36,48 @@ export async function InAppWalletAnalytics({
);
}
+type AsyncInAppWalletAnalyticsProps = Omit<
+ InAppWalletAnalyticsProps,
+ "stats" | "isPending"
+> & {
+ teamId: string;
+ projectId: string;
+};
+
+async function AsyncInAppWalletAnalytics(
+ props: AsyncInAppWalletAnalyticsProps,
+) {
+ const range = props.range ?? getLastNDaysRange("last-120");
+
+ const stats = await getInAppWalletUsage({
+ teamId: props.teamId,
+ projectId: props.projectId,
+ from: range.from,
+ to: range.to,
+ period: props.interval,
+ }).catch((error) => {
+ console.error(error);
+ return [];
+ });
+
+ return (
+
+ );
+}
+
+export function InAppWalletAnalytics(props: AsyncInAppWalletAnalyticsProps) {
+ return (
+
+ }
+ >
+
+
+ );
+}
diff --git a/apps/dashboard/src/components/smart-wallets/AccountAbstractionAnalytics/AccountAbstractionSummary.tsx b/apps/dashboard/src/components/smart-wallets/AccountAbstractionAnalytics/AccountAbstractionSummary.tsx
index e0de3dec7f7..871ae786b90 100644
--- a/apps/dashboard/src/components/smart-wallets/AccountAbstractionAnalytics/AccountAbstractionSummary.tsx
+++ b/apps/dashboard/src/components/smart-wallets/AccountAbstractionAnalytics/AccountAbstractionSummary.tsx
@@ -1,18 +1,22 @@
-import { Stat } from "components/analytics/stat";
+import { getAggregateUserOpUsage } from "@/api/analytics";
+import { StatCard } from "components/analytics/stat";
import { ActivityIcon, CoinsIcon } from "lucide-react";
+import { Suspense } from "react";
import type { UserOpStats } from "types/analytics";
-export function AccountAbstractionSummary(props: {
- aggregateUserOpUsageQuery?: UserOpStats;
+function AccountAbstractionSummaryInner(props: {
+ aggregateUserOpUsageQuery: UserOpStats | undefined;
+ isPending: boolean;
}) {
return (
-
-
@@ -22,7 +26,46 @@ export function AccountAbstractionSummary(props: {
}).format(value)
}
icon={CoinsIcon}
+ isPending={props.isPending}
/>
);
}
+
+async function AsyncAccountAbstractionSummary(props: {
+ teamId: string;
+ projectId: string;
+}) {
+ const aggregateUserOpStats = await getAggregateUserOpUsage({
+ teamId: props.teamId,
+ projectId: props.projectId,
+ });
+
+ return (
+
+ );
+}
+
+export function AccountAbstractionSummary(props: {
+ teamId: string;
+ projectId: string;
+}) {
+ return (
+
+ }
+ >
+
+
+ );
+}
diff --git a/apps/dashboard/src/components/smart-wallets/AccountAbstractionAnalytics/index.tsx b/apps/dashboard/src/components/smart-wallets/AccountAbstractionAnalytics/index.tsx
index 8f1fac41f1c..df0b8a88a74 100644
--- a/apps/dashboard/src/components/smart-wallets/AccountAbstractionAnalytics/index.tsx
+++ b/apps/dashboard/src/components/smart-wallets/AccountAbstractionAnalytics/index.tsx
@@ -12,7 +12,6 @@ import type { ThirdwebClient } from "thirdweb";
import type { UserOpStats } from "types/analytics";
import { SponsoredTransactionsTable } from "../../../app/team/[team_slug]/(team)/~/usage/overview/components/SponsoredTransactionsTable";
import { searchParams } from "../../../app/team/[team_slug]/[project_slug]/connect/account-abstraction/search-params";
-import { AccountAbstractionSummary } from "./AccountAbstractionSummary";
import { SponsoredTransactionsChartCard } from "./SponsoredTransactionsChartCard";
import { TotalSponsoredChartCard } from "./TotalSponsoredChartCard";
@@ -22,7 +21,6 @@ export function AccountAbstractionAnalytics(props: {
teamSlug: string;
client: ThirdwebClient;
projectId: string;
- aggregateUserOpStats: UserOpStats;
}) {
const [isLoading, startTransition] = useTransition();
@@ -67,12 +65,6 @@ export function AccountAbstractionAnalytics(props: {
return (