handle pagination in specialities and fix warning
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import { Pagination as PaginationMUI } from "@mui/material";
|
||||
|
||||
function Pagination() {
|
||||
function Pagination({ page, setPage, list, itemsPerPage }) {
|
||||
const handleChange = (_, value) => setPage(value);
|
||||
|
||||
return (
|
||||
<PaginationMUI
|
||||
// count={doctors.length / 12} org
|
||||
count={20}
|
||||
count={list && itemsPerPage ? Math.ceil(list.length / itemsPerPage) : 20}
|
||||
page={page || 1}
|
||||
onChange={setPage && handleChange}
|
||||
color="primary"
|
||||
sx={{
|
||||
"& .mui-8q7g72-MuiButtonBase-root-MuiPaginationItem-root": {
|
||||
@@ -13,9 +16,9 @@ function Pagination() {
|
||||
fontWeight: "500",
|
||||
},
|
||||
"& .mui-8q7g72-MuiButtonBase-root-MuiPaginationItem-root.Mui-selected":
|
||||
{
|
||||
color: "#F8F8FF",
|
||||
},
|
||||
{
|
||||
color: "#F8F8FF",
|
||||
},
|
||||
"& .MuiSvgIcon-root": {
|
||||
rotate: "180deg !important",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user