init
This commit is contained in:
31
src/components/ui-kit/BasePagination/index.tsx
Normal file
31
src/components/ui-kit/BasePagination/index.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import * as React from 'react';
|
||||
import Pagination from '@mui/material/Pagination';
|
||||
import Stack from '@mui/material/Stack';
|
||||
|
||||
interface BasePaginationProps {
|
||||
page: number;
|
||||
totalCount: number;
|
||||
pageSize: number;
|
||||
onChange: (newPage: number) => void;
|
||||
}
|
||||
|
||||
export default function BasePagination({ page, pageSize, totalCount, onChange }: BasePaginationProps) {
|
||||
return (
|
||||
<Stack spacing={2}>
|
||||
<Pagination
|
||||
page={page}
|
||||
count={Math.ceil(totalCount / pageSize)}
|
||||
onChange={(_, newPage) => onChange(newPage)}
|
||||
variant='outlined'
|
||||
shape='rounded'
|
||||
color='primary'
|
||||
sx={{
|
||||
'.Mui-selected': {
|
||||
backgroundColor: theme => theme.palette.primary.main,
|
||||
color: '#fff',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user