aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/lib/hooks
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2026-02-04 14:02:05 +0000
committerGitHub <noreply@github.com>2026-02-04 14:02:05 +0000
commite59fd98b43070898c594c35af1a0bbee604ad160 (patch)
tree11239ffd3c5325a3d7a913e0b44fc70ae4cf8d31 /apps/web/lib/hooks
parent6e5820311cca68987d0fe6e50c95d4c9f4f5ce13 (diff)
downloadkarakeep-e59fd98b43070898c594c35af1a0bbee604ad160.tar.zst
feat(import): new import details page (#2451)
* feat(import): new import details page * fix typecheck * review comments
Diffstat (limited to 'apps/web/lib/hooks')
-rw-r--r--apps/web/lib/hooks/useImportSessions.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/apps/web/lib/hooks/useImportSessions.ts b/apps/web/lib/hooks/useImportSessions.ts
index 4d095c0b..2cc632ad 100644
--- a/apps/web/lib/hooks/useImportSessions.ts
+++ b/apps/web/lib/hooks/useImportSessions.ts
@@ -1,7 +1,12 @@
"use client";
import { toast } from "@/components/ui/sonner";
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
+import {
+ useInfiniteQuery,
+ useMutation,
+ useQuery,
+ useQueryClient,
+} from "@tanstack/react-query";
import { useTRPC } from "@karakeep/shared-react/trpc";
@@ -131,3 +136,16 @@ export function useResumeImportSession() {
}),
);
}
+
+export function useImportSessionResults(
+ importSessionId: string,
+ filter: "all" | "accepted" | "rejected" | "skipped_duplicate" | "pending",
+) {
+ const api = useTRPC();
+ return useInfiniteQuery(
+ api.importSessions.getImportSessionResults.infiniteQueryOptions(
+ { importSessionId, filter, limit: 50 },
+ { getNextPageParam: (lastPage) => lastPage.nextCursor },
+ ),
+ );
+}