mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Pagination component
This commit is contained in:
@@ -5,6 +5,7 @@ import AddSite from "@/components/dialogues/AddSite";
|
||||
import Sites from "@/components/cards/Sites";
|
||||
import axios from "axios";
|
||||
import { useEffect, useState } from "react";
|
||||
import Pagination from "@/components/Pagination";
|
||||
|
||||
interface SitesPageProps {
|
||||
username: string;
|
||||
@@ -67,13 +68,12 @@ export default function SitesPage({ username, name }: SitesPageProps) {
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="flex justify-center pt-4">
|
||||
<div className="join">
|
||||
<button className="join-item btn" onClick={() => handlePageChange(currentPage - 1)} disabled={currentPage === 1}>«</button>
|
||||
<button className="join-item btn">Page {currentPage}</button>
|
||||
<button className="join-item btn" onClick={() => handlePageChange(currentPage + 1)} disabled={currentPage === Math.ceil(total / itemPerPage)}>»</button>
|
||||
</div>
|
||||
</div>
|
||||
<Pagination
|
||||
currentPage={currentPage}
|
||||
totalItems={total}
|
||||
itemsPerPage={itemPerPage}
|
||||
onPageChange={handlePageChange}
|
||||
/>
|
||||
</main>
|
||||
</Sidebar>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user