@@ -2,8 +2,7 @@ import { ChevronRightIcon } from "@heroicons/react/24/outline";
22import { ChevronLeftIcon } from "@heroicons/react/24/solid" ;
33import { Link , useLocation } from "@remix-run/react" ;
44import { cn } from "~/utils/cn" ;
5- import { ButtonContent } from "./Buttons" ;
6- import { LinkDisabled } from "./LinkWithDisabled" ;
5+ import { LinkButton } from "./Buttons" ;
76
87export function PaginationControls ( {
98 currentPage,
@@ -21,33 +20,37 @@ export function PaginationControls({
2120
2221 return (
2322 < nav className = "flex items-center gap-0.5" aria-label = "Pagination" >
24- < LinkDisabled
23+ < LinkButton
2524 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"
2730 disabled = { currentPage === 1 }
28- disabledClassName = "opacity-30 cursor-default"
31+ className = { currentPage > 1 ? "group" : "" }
2932 >
30- < ButtonContent variant = "minimal/small" LeadingIcon = { ChevronLeftIcon } >
31- Prev
32- </ ButtonContent >
33- </ LinkDisabled >
33+ Prev
34+ </ LinkButton >
3435
3536 { showPageNumbers
3637 ? calculatePageLinks ( currentPage , totalPages ) . map ( ( page , i ) => (
3738 < PageLinkComponent page = { page } key = { i } location = { location } />
3839 ) )
3940 : null }
4041
41- < LinkDisabled
42+ < LinkButton
4243 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"
4449 disabled = { currentPage === totalPages }
45- disabledClassName = "opacity-30 cursor-default"
50+ className = { currentPage !== totalPages ? "group" : "" }
4651 >
47- < ButtonContent variant = "minimal/small" TrailingIcon = { ChevronRightIcon } >
48- Next
49- </ ButtonContent >
50- </ LinkDisabled >
52+ Next
53+ </ LinkButton >
5154 </ nav >
5255 ) ;
5356}
0 commit comments