From 65f6e83f11c82b0ec762e11f3392a80e614ee69a Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
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/components/dashboard/preview/HighlightsBox.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'apps/web/components/dashboard/preview/HighlightsBox.tsx')

diff --git a/apps/web/components/dashboard/preview/HighlightsBox.tsx b/apps/web/components/dashboard/preview/HighlightsBox.tsx
index 41ab7d74..d4821655 100644
--- a/apps/web/components/dashboard/preview/HighlightsBox.tsx
+++ b/apps/web/components/dashboard/preview/HighlightsBox.tsx
@@ -5,8 +5,9 @@ import {
   CollapsibleTrigger,
 } from "@/components/ui/collapsible";
 import { useTranslation } from "@/lib/i18n/client";
-import { api } from "@/lib/trpc";
+import { useTRPC } from "@/lib/trpc";
 import { Separator } from "@radix-ui/react-dropdown-menu";
+import { useQuery } from "@tanstack/react-query";
 import { ChevronsDownUp } from "lucide-react";
 
 import HighlightCard from "../highlights/HighlightCard";
@@ -18,10 +19,12 @@ export default function HighlightsBox({
   bookmarkId: string;
   readOnly: boolean;
 }) {
+  const api = useTRPC();
   const { t } = useTranslation();
 
-  const { data: highlights, isPending: isLoading } =
-    api.highlights.getForBookmark.useQuery({ bookmarkId });
+  const { data: highlights, isPending: isLoading } = useQuery(
+    api.highlights.getForBookmark.queryOptions({ bookmarkId }),
+  );
 
   if (isLoading || !highlights || highlights?.highlights.length === 0) {
     return null;
-- 
cgit v1.2.3-70-g09d2

