From 2fa8c1b6001404f83e55e65064e1b48e83290ec6 Mon Sep 17 00:00:00 2001
From: KM Koushik
Date: Fri, 19 Sep 2025 08:24:08 +1000
Subject: [PATCH] fix build
---
AGENTS.md | 2 +-
.../admin/email-analytics/page.tsx | 24 +++++++++++--------
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/AGENTS.md b/AGENTS.md
index 50278f1..e6d4dca 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -41,4 +41,4 @@
- Prefer Conventional Commits (`feat:`, `fix:`, `chore:`, `docs:`). Git history shows frequent feat/fix usage.
- PRs must include: clear description, linked issues, screenshots for UI changes, migration notes, and verification steps.
-- CI hygiene: ensure `pnpm lint` and `pnpm build` pass; run relevant `db:*` scripts if schema changes.
+- never run build,migration commands unless asked for
diff --git a/apps/web/src/app/(dashboard)/admin/email-analytics/page.tsx b/apps/web/src/app/(dashboard)/admin/email-analytics/page.tsx
index 2864d8e..759cfb7 100644
--- a/apps/web/src/app/(dashboard)/admin/email-analytics/page.tsx
+++ b/apps/web/src/app/(dashboard)/admin/email-analytics/page.tsx
@@ -23,12 +23,12 @@ import Spinner from "@usesend/ui/src/spinner";
import { api } from "~/trpc/react";
import { isCloud } from "~/utils/common";
import { timeframeOptions } from "./constants";
+import { keepPreviousData } from "@tanstack/react-query";
export default function AdminEmailAnalyticsPage() {
const isCloudEnv = isCloud();
- const [timeframe, setTimeframe] = useState<
- (typeof timeframeOptions)[number]["value"]
- >("today");
+ const [timeframe, setTimeframe] =
+ useState<(typeof timeframeOptions)[number]["value"]>("today");
const [paidOnly, setPaidOnly] = useState(false);
const analyticsQuery = api.admin.getEmailAnalytics.useQuery(
@@ -36,7 +36,7 @@ export default function AdminEmailAnalyticsPage() {
timeframe,
paidOnly,
},
- { keepPreviousData: true, enabled: isCloudEnv }
+ { enabled: isCloudEnv, placeholderData: keepPreviousData }
);
const data = analyticsQuery.data;
@@ -111,9 +111,7 @@ export default function AdminEmailAnalyticsPage() {
) : null}
- {analyticsQuery.isLoading ? (
-
- ) : null}
+ {analyticsQuery.isLoading ? : null}
@@ -149,12 +147,18 @@ export default function AdminEmailAnalyticsPage() {
{row.name}
{row.plan}
{row.sent}
- {row.delivered}
+
+ {row.delivered}
+
{row.opened}
{row.clicked}
{row.bounced}
- {row.complained}
- {row.hardBounced}
+
+ {row.complained}
+
+
+ {row.hardBounced}
+
))
)}