Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2967 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3719 stevensc 1
import React from 'react';
2
import { Pagination as MuiPagination, styled } from '@mui/material';
3
 
4
const StyledPagination = styled(MuiPagination)(({ theme }) => ({
5
  padding: theme.spacing(0, 1),
6
  '.MuiPagination-ul': {
7
    width: '100%',
8
    display: 'flex',
9
    alignItems: 'center',
10
    justifyContent: 'space-around',
11
    gap: theme.spacing(0.5)
12
  },
13
  '.MuiPaginationItem-root': {
14
    borderRadius: '65%',
15
    height: '30px',
16
    width: '30px'
17
  }
18
}));
19
 
20
const Pagination = ({ pages = 1, page = 1, onChange = () => {} }) => {
21
  const currentPage = Number(page) || 1;
22
 
23
  const handleChange = (event, value) => onChange(value);
24
 
25
  if (pages <= 1) {
26
    return null;
27
  }
28
 
29
  return (
30
    <StyledPagination
31
      count={pages}
32
      page={currentPage}
33
      onChange={handleChange}
34
      variant='outlined'
35
      color='secondary'
36
    />
37
  );
38
};
39
 
40
export default Pagination;