pagination added for admin dashboard table
This commit is contained in:
parent
374ae9dd4b
commit
48ad768b0f
@ -7,6 +7,9 @@ import { CheckCircle2, XCircle, Eye } from 'lucide-react';
|
|||||||
const SubmissionTable = ({ selectedQuarter, selectedYear }) => {
|
const SubmissionTable = ({ selectedQuarter, selectedYear }) => {
|
||||||
const [data, setData] = useState([]);
|
const [data, setData] = useState([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [currentPage, setCurrentPage] = React.useState(1);
|
||||||
|
const pageSize = 10;
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -151,6 +154,12 @@ const SubmissionTable = ({ selectedQuarter, selectedYear }) => {
|
|||||||
rows={tableRows}
|
rows={tableRows}
|
||||||
separated
|
separated
|
||||||
rowGapClass="border-spacing-y-1"
|
rowGapClass="border-spacing-y-1"
|
||||||
|
pagination={{
|
||||||
|
currentPage,
|
||||||
|
onPageChange: setCurrentPage,
|
||||||
|
pageSize,
|
||||||
|
totalItems: filtered.length,
|
||||||
|
}}
|
||||||
columnWidths={columnWidths}
|
columnWidths={columnWidths}
|
||||||
renderCell={(value, _, columnIndex) => {
|
renderCell={(value, _, columnIndex) => {
|
||||||
if (columnIndex === 10) {
|
if (columnIndex === 10) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user