Skip to content

Commit 9fb2455

Browse files
committed
Remove hardcoded prev/next labels
1 parent 1dbc908 commit 9fb2455

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/ui/pagination.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ function PaginationLink<C extends React.ElementType = 'a'>({
7070

7171
function PaginationPrevious({
7272
className,
73+
label = '',
7374
linkComponent,
7475
...props
7576
}: React.ComponentProps<typeof PaginationLink>) {
@@ -82,12 +83,17 @@ function PaginationPrevious({
8283
{...props}
8384
>
8485
<ChevronLeftIcon />
85-
<span className="hidden sm:block">Previous</span>
86+
{label && <span className="hidden sm:block">{label}</span>}
8687
</PaginationLink>
8788
)
8889
}
8990

90-
function PaginationNext({ className, linkComponent, ...props }: React.ComponentProps<typeof PaginationLink>) {
91+
function PaginationNext({
92+
className,
93+
label,
94+
linkComponent,
95+
...props
96+
}: React.ComponentProps<typeof PaginationLink>) {
9197
return (
9298
<PaginationLink
9399
aria-label="Go to next page"
@@ -96,7 +102,7 @@ function PaginationNext({ className, linkComponent, ...props }: React.ComponentP
96102
linkComponent={linkComponent}
97103
{...props}
98104
>
99-
<span className="hidden sm:block">Next</span>
105+
{label && <span className="hidden sm:block">{label}</span>}
100106
<ChevronRightIcon />
101107
</PaginationLink>
102108
)

0 commit comments

Comments
 (0)