File tree Expand file tree Collapse file tree 3 files changed +4
-142
lines changed Expand file tree Collapse file tree 3 files changed +4
-142
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import Fa6SolidAngleLeft from "~icons/fa6-solid/angle-left";
9
9
import Fa6SolidAngleRight from "~icons/fa6-solid/angle-right" ;
10
10
11
11
import type { PaginationMeta } from "../../../generated/api/schemas/paginationMeta" ;
12
- import { buildPaginationMeta } from "../pagination" ;
13
12
import type { noteSearchParamSchema } from "../validation" ;
14
13
15
14
type PaginationProps = {
@@ -29,18 +28,16 @@ export const SearchPagination = ({
29
28
visibleItemCount,
30
29
...groupProps
31
30
} : PaginationProps ) => {
32
- const pagination = buildPaginationMeta ( meta , currentQuery ) ;
33
-
34
31
const pageFirstItemIndex = currentQuery . offset + 1 ;
35
32
const totalDisplayedItems = currentQuery . offset + visibleItemCount ;
36
33
37
34
const prevTo = useMemo (
38
- ( ) => ( pagination ?. prev ? withQuery ( "/" , getQuery ( pagination . prev ) ) : null ) ,
39
- [ pagination ?. prev ] ,
35
+ ( ) => ( meta ?. prev ? withQuery ( "/" , getQuery ( meta . prev ) ) : null ) ,
36
+ [ meta ?. prev ] ,
40
37
) ;
41
38
const nextTo = useMemo (
42
- ( ) => ( pagination ?. next ? withQuery ( "/" , getQuery ( pagination . next ) ) : null ) ,
43
- [ pagination ?. next ] ,
39
+ ( ) => ( meta ?. next ? withQuery ( "/" , getQuery ( meta . next ) ) : null ) ,
40
+ [ meta ?. next ] ,
44
41
) ;
45
42
46
43
const [ clickedButton , setClickedButton ] = useState < "prev" | "next" > ( ) ;
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments