From 65f6e83f11c82b0ec762e11f3392a80e614ee69a Mon Sep 17 00:00:00 2001
From: Mohamed Bassem
Date: Sun, 1 Feb 2026 12:29:54 +0000
Subject: refactor: migrate trpc to the new react query integration mode
(#2438)
* refactor: migrate trpc to the new react query integration mode
* more fixes
* more migrations
* upgrade trpc client
---
apps/web/app/settings/stats/page.tsx | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
(limited to 'apps/web/app/settings/stats/page.tsx')
diff --git a/apps/web/app/settings/stats/page.tsx b/apps/web/app/settings/stats/page.tsx
index 28c017f5..06076376 100644
--- a/apps/web/app/settings/stats/page.tsx
+++ b/apps/web/app/settings/stats/page.tsx
@@ -6,7 +6,8 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Progress } from "@/components/ui/progress";
import { Skeleton } from "@/components/ui/skeleton";
import { useTranslation } from "@/lib/i18n/client";
-import { api } from "@/lib/trpc";
+import { useTRPC } from "@/lib/trpc";
+import { useQuery } from "@tanstack/react-query";
import {
Archive,
BarChart3,
@@ -159,9 +160,10 @@ function StatCard({
}
export default function StatsPage() {
+ const api = useTRPC();
const { t } = useTranslation();
- const { data: stats, isLoading } = api.users.stats.useQuery();
- const { data: userSettings } = api.users.settings.useQuery();
+ const { data: stats, isLoading } = useQuery(api.users.stats.queryOptions());
+ const { data: userSettings } = useQuery(api.users.settings.queryOptions());
const maxHourlyActivity = useMemo(() => {
if (!stats) return 0;
@@ -237,7 +239,6 @@ export default function StatsPage() {
-
{/* Overview Stats */}
-
{/* Bookmark Types */}
@@ -532,7 +532,6 @@ export default function StatsPage() {
-
{/* Activity Patterns */}
{/* Hourly Activity */}
@@ -583,7 +582,6 @@ export default function StatsPage() {
-
{/* Asset Storage */}
{stats.assetsByType.length > 0 && (
--
cgit v1.2.3-70-g09d2