From a84393590eb5f56c04dae07673f745264406cc91 Mon Sep 17 00:00:00 2001
From: Timothy Yin
Date: Wed, 11 Mar 2026 00:29:04 +0800
Subject: [PATCH] feat: add refresh button to various dashboard pages for
improved data fetching
---
.../app/dashboard/charge-points/[id]/page.tsx | 19 +++++++-----
apps/web/app/dashboard/charge-points/page.tsx | 19 +++++++-----
apps/web/app/dashboard/page.tsx | 31 +++++++++++++------
apps/web/app/dashboard/transactions/page.tsx | 12 ++++---
apps/web/app/dashboard/users/page.tsx | 21 +++++++++++--
5 files changed, 72 insertions(+), 30 deletions(-)
diff --git a/apps/web/app/dashboard/charge-points/[id]/page.tsx b/apps/web/app/dashboard/charge-points/[id]/page.tsx
index ca66225..058fca5 100644
--- a/apps/web/app/dashboard/charge-points/[id]/page.tsx
+++ b/apps/web/app/dashboard/charge-points/[id]/page.tsx
@@ -16,7 +16,7 @@ import {
Table,
TextField,
} from "@heroui/react";
-import { ArrowLeft, Pencil, PlugConnection } from "@gravity-ui/icons";
+import { ArrowLeft, Pencil, PlugConnection, ArrowRotateRight } from "@gravity-ui/icons";
import { api } from "@/lib/api";
import { useSession } from "@/lib/auth-client";
@@ -107,7 +107,7 @@ export default function ChargePointDetailPage({ params }: { params: Promise<{ id
feePerKwh: "0",
});
- const cpQuery = useQuery({
+ const { isFetching: refreshing, ...cpQuery } = useQuery({
queryKey: ["chargePoint", id],
queryFn: () => api.chargePoints.get(id),
refetchInterval: 3_000,
@@ -227,12 +227,17 @@ export default function ChargePointDetailPage({ params }: { params: Promise<{ id
)}
- {isAdmin && (
-