From e59fd98b43070898c594c35af1a0bbee604ad160 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Wed, 4 Feb 2026 14:02:05 +0000 Subject: feat(import): new import details page (#2451) * feat(import): new import details page * fix typecheck * review comments --- apps/web/lib/hooks/useImportSessions.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'apps/web/lib/hooks') 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 }, + ), + ); +} -- cgit v1.2.3-70-g09d2