@@ -2,8 +2,7 @@ import { ChevronRightIcon } from "@heroicons/react/24/outline";
2
2
import { ChevronLeftIcon } from "@heroicons/react/24/solid" ;
3
3
import { Link , useLocation } from "@remix-run/react" ;
4
4
import { cn } from "~/utils/cn" ;
5
- import { ButtonContent } from "./Buttons" ;
6
- import { LinkDisabled } from "./LinkWithDisabled" ;
5
+ import { LinkButton } from "./Buttons" ;
7
6
8
7
export function PaginationControls ( {
9
8
currentPage,
@@ -21,33 +20,37 @@ export function PaginationControls({
21
20
22
21
return (
23
22
< nav className = "flex items-center gap-0.5" aria-label = "Pagination" >
24
- < LinkDisabled
23
+ < LinkButton
25
24
to = { pageUrl ( location , currentPage - 1 ) }
26
- className = { currentPage > 1 ? "group" : "" }
25
+ variant = "minimal/small"
26
+ LeadingIcon = { ChevronLeftIcon }
27
+ shortcut = { { key : "j" } }
28
+ showTooltip
29
+ tooltipDescription = "Previous"
27
30
disabled = { currentPage === 1 }
28
- disabledClassName = "opacity-30 cursor-default"
31
+ className = { currentPage > 1 ? "group" : "" }
29
32
>
30
- < ButtonContent variant = "minimal/small" LeadingIcon = { ChevronLeftIcon } >
31
- Prev
32
- </ ButtonContent >
33
- </ LinkDisabled >
33
+ Prev
34
+ </ LinkButton >
34
35
35
36
{ showPageNumbers
36
37
? calculatePageLinks ( currentPage , totalPages ) . map ( ( page , i ) => (
37
38
< PageLinkComponent page = { page } key = { i } location = { location } />
38
39
) )
39
40
: null }
40
41
41
- < LinkDisabled
42
+ < LinkButton
42
43
to = { pageUrl ( location , currentPage + 1 ) }
43
- className = { currentPage !== totalPages ? "group" : "" }
44
+ variant = "minimal/small"
45
+ TrailingIcon = { ChevronRightIcon }
46
+ shortcut = { { key : "k" } }
47
+ showTooltip
48
+ tooltipDescription = "Next"
44
49
disabled = { currentPage === totalPages }
45
- disabledClassName = "opacity-30 cursor-default"
50
+ className = { currentPage !== totalPages ? "group" : "" }
46
51
>
47
- < ButtonContent variant = "minimal/small" TrailingIcon = { ChevronRightIcon } >
48
- Next
49
- </ ButtonContent >
50
- </ LinkDisabled >
52
+ Next
53
+ </ LinkButton >
51
54
</ nav >
52
55
) ;
53
56
}
0 commit comments