fix build

This commit is contained in:
KM Koushik
2025-09-19 08:24:08 +10:00
parent 81faba2aba
commit 2fa8c1b600
2 changed files with 15 additions and 11 deletions

View File

@@ -41,4 +41,4 @@
- Prefer Conventional Commits (`feat:`, `fix:`, `chore:`, `docs:`). Git history shows frequent feat/fix usage. - 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. - 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

View File

@@ -23,12 +23,12 @@ import Spinner from "@usesend/ui/src/spinner";
import { api } from "~/trpc/react"; import { api } from "~/trpc/react";
import { isCloud } from "~/utils/common"; import { isCloud } from "~/utils/common";
import { timeframeOptions } from "./constants"; import { timeframeOptions } from "./constants";
import { keepPreviousData } from "@tanstack/react-query";
export default function AdminEmailAnalyticsPage() { export default function AdminEmailAnalyticsPage() {
const isCloudEnv = isCloud(); const isCloudEnv = isCloud();
const [timeframe, setTimeframe] = useState< const [timeframe, setTimeframe] =
(typeof timeframeOptions)[number]["value"] useState<(typeof timeframeOptions)[number]["value"]>("today");
>("today");
const [paidOnly, setPaidOnly] = useState(false); const [paidOnly, setPaidOnly] = useState(false);
const analyticsQuery = api.admin.getEmailAnalytics.useQuery( const analyticsQuery = api.admin.getEmailAnalytics.useQuery(
@@ -36,7 +36,7 @@ export default function AdminEmailAnalyticsPage() {
timeframe, timeframe,
paidOnly, paidOnly,
}, },
{ keepPreviousData: true, enabled: isCloudEnv } { enabled: isCloudEnv, placeholderData: keepPreviousData }
); );
const data = analyticsQuery.data; const data = analyticsQuery.data;
@@ -111,9 +111,7 @@ export default function AdminEmailAnalyticsPage() {
</p> </p>
) : null} ) : null}
</div> </div>
{analyticsQuery.isLoading ? ( {analyticsQuery.isLoading ? <Spinner className="h-4 w-4" /> : null}
<Spinner className="h-4 w-4" />
) : null}
</CardHeader> </CardHeader>
<CardContent className="p-0"> <CardContent className="p-0">
<Table> <Table>
@@ -149,12 +147,18 @@ export default function AdminEmailAnalyticsPage() {
<TableCell>{row.name}</TableCell> <TableCell>{row.name}</TableCell>
<TableCell>{row.plan}</TableCell> <TableCell>{row.plan}</TableCell>
<TableCell className="text-right">{row.sent}</TableCell> <TableCell className="text-right">{row.sent}</TableCell>
<TableCell className="text-right">{row.delivered}</TableCell> <TableCell className="text-right">
{row.delivered}
</TableCell>
<TableCell className="text-right">{row.opened}</TableCell> <TableCell className="text-right">{row.opened}</TableCell>
<TableCell className="text-right">{row.clicked}</TableCell> <TableCell className="text-right">{row.clicked}</TableCell>
<TableCell className="text-right">{row.bounced}</TableCell> <TableCell className="text-right">{row.bounced}</TableCell>
<TableCell className="text-right">{row.complained}</TableCell> <TableCell className="text-right">
<TableCell className="text-right">{row.hardBounced}</TableCell> {row.complained}
</TableCell>
<TableCell className="text-right">
{row.hardBounced}
</TableCell>
</TableRow> </TableRow>
)) ))
)} )}