This commit is contained in:
parent
879d9939cb
commit
26703bfb74
@ -36,6 +36,21 @@ export default function Pagination(props: PaginationProps) {
|
|||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{currentPage !== 1 && currentPage - 2 > 1 && (
|
||||||
|
<>
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
className="rounded-md bg-neutral-700 px-3 py-1 hover:opacity-80"
|
||||||
|
onClick={() => onPageChange(1)}
|
||||||
|
>
|
||||||
|
1
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
<p>...</p>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
{pageNumbers.map((pageNumber) => (
|
{pageNumbers.map((pageNumber) => (
|
||||||
<li key={pageNumber}>
|
<li key={pageNumber}>
|
||||||
<button
|
<button
|
||||||
@ -50,6 +65,22 @@ export default function Pagination(props: PaginationProps) {
|
|||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
{currentPage !== totalPages && currentPage + 2 < totalPages && (
|
||||||
|
<>
|
||||||
|
<p>...</p>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
className="rounded-md bg-neutral-700 px-3 py-1 hover:opacity-80"
|
||||||
|
onClick={() => onPageChange(totalPages)}
|
||||||
|
>
|
||||||
|
{totalPages}
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
{currentPage < totalPages && (
|
{currentPage < totalPages && (
|
||||||
<li className="rounded-md bg-neutral-700 hover:opacity-80">
|
<li className="rounded-md bg-neutral-700 hover:opacity-80">
|
||||||
<button
|
<button
|
||||||
|
Loading…
Reference in New Issue
Block a user