diff --git a/frontend/src/components/DocumentPaginator/index.tsx b/frontend/src/components/DocumentPaginator/index.tsx index 3d72889..d55fb93 100644 --- a/frontend/src/components/DocumentPaginator/index.tsx +++ b/frontend/src/components/DocumentPaginator/index.tsx @@ -1,3 +1,4 @@ +import { CaretDown } from '@phosphor-icons/react'; import { numberWithCommas } from '../../utils/numbers'; function generatePageItems(total: number, current: number) { @@ -30,17 +31,37 @@ export default function DocumentListPagination({ gotoPage, }: IPaginationProps) { const pageItems = generatePageItems(pageCount, currentPage); + + const hasPrevious = currentPage > 1; + const hasNext = currentPage < pageCount; + + const goToPrevious = () => { + if (currentPage > 1) gotoPage(currentPage - 1); + }; + + const goToNext = () => { + if (currentPage < pageCount) gotoPage(currentPage + 1); + }; + return ( -
+
+ {hasPrevious && ( + + )} + {hasNext && ( + + )}
); } diff --git a/frontend/src/pages/DocumentView/FragmentList/index.tsx b/frontend/src/pages/DocumentView/FragmentList/index.tsx index cb9c850..5943e86 100644 --- a/frontend/src/pages/DocumentView/FragmentList/index.tsx +++ b/frontend/src/pages/DocumentView/FragmentList/index.tsx @@ -64,7 +64,10 @@ export default function FragmentList({ }, [document, currentPage]); return ( <> -
+
@@ -89,7 +92,7 @@ export default function FragmentList({
-
+
{loading || searching ? (
@@ -104,7 +107,7 @@ export default function FragmentList({
) : ( - + + @@ -144,7 +153,7 @@ export default function FragmentList({
Metadata + {' '} +
)} - {searchMode && searchFragments.length === 0 && ( + {searchMode && searchFragments.length === 0 && !searching && (

diff --git a/frontend/src/pages/DocumentView/index.tsx b/frontend/src/pages/DocumentView/index.tsx index dc3fe23..474aef0 100644 --- a/frontend/src/pages/DocumentView/index.tsx +++ b/frontend/src/pages/DocumentView/index.tsx @@ -122,7 +122,7 @@ export default function DocumentView() { } >

-
+