diff options
| author | Mohamed Bassem <me@mbassem.com> | 2024-12-22 16:17:22 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2024-12-22 23:38:38 +0000 |
| commit | 353e5d6374c77a2744590a5bfd3329672009b281 (patch) | |
| tree | 5a64f13ddc930fbcf699101248b35f72cda6fc6b /apps/web/app | |
| parent | 71d7490d0a647e9254bf15b38201177057d88f95 (diff) | |
| download | karakeep-353e5d6374c77a2744590a5bfd3329672009b281.tar.zst | |
feat: Add basic pagination to searchBookmarks tRPC
Diffstat (limited to 'apps/web/app')
| -rw-r--r-- | apps/web/app/dashboard/search/page.tsx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/web/app/dashboard/search/page.tsx b/apps/web/app/dashboard/search/page.tsx index a239550c..beae73b8 100644 --- a/apps/web/app/dashboard/search/page.tsx +++ b/apps/web/app/dashboard/search/page.tsx @@ -6,12 +6,18 @@ import { FullPageSpinner } from "@/components/ui/full-page-spinner"; import { useBookmarkSearch } from "@/lib/hooks/bookmark-search"; function SearchComp() { - const { data } = useBookmarkSearch(); + const { data, hasNextPage, fetchNextPage, isFetchingNextPage } = + useBookmarkSearch(); return ( <div className="flex flex-col gap-3"> {data ? ( - <BookmarksGrid bookmarks={data.bookmarks} /> + <BookmarksGrid + hasNextPage={hasNextPage} + fetchNextPage={fetchNextPage} + isFetchingNextPage={isFetchingNextPage} + bookmarks={data.pages.flatMap((b) => b.bookmarks)} + /> ) : ( <FullPageSpinner /> )} |
