pager finished
This commit is contained in:
parent
5ebf4a1a46
commit
4f9882a389
@ -4,7 +4,7 @@ import { useNavigate } from "react-router-dom";
|
||||
import Button from '@mui/material/Button';
|
||||
import ButtonGroup from '@mui/material/ButtonGroup';
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
import Grid from '@mui/material/Grid';
|
||||
|
||||
const Pager = (props:any): JSX.Element => {
|
||||
|
||||
@ -23,13 +23,15 @@ const Pager = (props:any): JSX.Element => {
|
||||
}
|
||||
|
||||
return (
|
||||
<ButtonGroup variant="contained" aria-label="outlined primary button group">
|
||||
<Button disabled={page === 1} onClick={() => navigate("/")}>First</Button>
|
||||
<Button disabled={page === 1} onClick={() => handlePager(page - 1)}>Prev</Button>
|
||||
<Typography style={{ padding: 10}}>Page {page} from {lastPage}</Typography>
|
||||
<Button disabled={page === lastPage} onClick={() => handlePager(page + 1)}>Next</Button>
|
||||
<Button disabled={page === lastPage} onClick={() => handlePager(lastPage)}>Last</Button>
|
||||
</ButtonGroup>
|
||||
<Grid container justifyContent="center">
|
||||
<ButtonGroup variant="contained" aria-label="outlined primary button group">
|
||||
<Button disabled={page === 1} onClick={() => navigate("/")}>First</Button>
|
||||
<Button disabled={page === 1} onClick={() => handlePager(page - 1)}>Prev</Button>
|
||||
<Typography style={{ padding: 10}}>Page {page} from {lastPage}</Typography>
|
||||
<Button disabled={page === lastPage} onClick={() => handlePager(page + 1)}>Next</Button>
|
||||
<Button disabled={page === lastPage} onClick={() => handlePager(lastPage)}>Last</Button>
|
||||
</ButtonGroup>
|
||||
</Grid>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user