diff --git a/src/app/private/volunteers/page.tsx b/src/app/private/volunteers/page.tsx index e1d9743..b76e553 100644 --- a/src/app/private/volunteers/page.tsx +++ b/src/app/private/volunteers/page.tsx @@ -2,11 +2,12 @@ import VolunteerTable from "@components/VolunteerTable/VolunteerTable"; import SearchBar from "@components/SearchBar"; const VolunteerHomePage = () => { + return (

Volunteer Home

- +
); }; diff --git a/src/components/VolunteerTable/VolunteerTable.tsx b/src/components/VolunteerTable/VolunteerTable.tsx index 8ad3352..85c1268 100644 --- a/src/components/VolunteerTable/VolunteerTable.tsx +++ b/src/components/VolunteerTable/VolunteerTable.tsx @@ -1,16 +1,25 @@ +'use client'; + import Table from "@mui/material/Table"; import TableBody from "@mui/material/TableBody"; import TableCell from "@mui/material/TableCell"; import TableContainer from "@mui/material/TableContainer"; import TableHead from "@mui/material/TableHead"; import TableRow from "@mui/material/TableRow"; +import TablePagination from "@mui/material/TablePagination"; import Avatar from "@mui/material/Avatar"; import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline"; import ArrowRightAltIcon from "@mui/icons-material/ArrowRightAlt"; import IconButton from "@mui/material/IconButton"; +import Checkbox from "@mui/material/Checkbox"; +import React, { useState } from "react"; import profilePic from "../../../public/profile.png"; +interface VolunteerTableProps { + showPagination: boolean; +} + function createData( name: string, type: number, @@ -37,9 +46,31 @@ const rows = [ createData("Name1", 0, "email1", "location1"), createData("Name2", 1, "email2", "location2"), createData("Name3", 2, "email3", "location2"), + createData("Name4", 0, "email1", "location1"), + createData("Name5", 1, "email2", "location2"), + createData("Name6", 2, "email3", "location2"), + createData("Name7", 0, "email1", "location1"), + createData("Name8", 1, "email2", "location2"), + createData("Name9", 2, "email3", "location2"), + createData("Name10", 0, "email1", "location1"), + createData("Name11", 1, "email2", "location2"), + createData("Name12", 2, "email3", "location2"), + createData("Name13", 0, "email1", "location1"), + createData("Name14", 1, "email2", "location2"), + createData("Name15", 2, "email3", "location2"), ]; -export default function VolunteerTable() { +export default function VolunteerTable({ showPagination }: VolunteerTableProps) { + const [page, setPage] = useState(0); // Current page + const [rowsPerPage] = useState(8); // Set rows per page to 8 + + const handleChangePage = (event: unknown, newPage: number) => { + setPage(newPage); + }; + + // Pagination Logic + const paginatedRows = rows.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage); + return ( - {rows.map((row) => ( + {paginatedRows.map((row) => ( + {showPagination && ( + + )} ); }