Update pajinasyon with new awtis route
This commit is contained in:
@@ -1,42 +1,22 @@
|
||||
'use client'
|
||||
|
||||
import PropTypes from 'prop-types'
|
||||
import {useRouter} from 'next/router'
|
||||
import {styled} from '@mui/material/styles'
|
||||
import {useRouter} from 'next/navigation'
|
||||
import Pagination from '@mui/material/Pagination'
|
||||
import {Grid} from '@mui/material'
|
||||
|
||||
const PREFIX = 'pajinasyon'
|
||||
|
||||
const classes = {
|
||||
root: `${PREFIX}-root`
|
||||
}
|
||||
|
||||
const StyledGrid = styled(Grid)((
|
||||
{
|
||||
theme
|
||||
}
|
||||
) => ({
|
||||
[`& .${classes.root}`]: {
|
||||
'& > *': {
|
||||
marginTop: theme.spacing(2)
|
||||
}
|
||||
}
|
||||
}))
|
||||
import Grid from '@mui/material/Unstable_Grid2'
|
||||
|
||||
export default function Pajinasyon({pajTotal, paj}) {
|
||||
const router = useRouter()
|
||||
|
||||
const handleChange = (event, value) => {
|
||||
const href = `/awtis?paj&paj=${value}`
|
||||
const as = `/awtis/paj/${value}`
|
||||
router.push(href, as)
|
||||
const href = `/awtis?paj=${value}`
|
||||
router.push(href)
|
||||
}
|
||||
|
||||
return (
|
||||
<StyledGrid container justifyContent='center'>
|
||||
<div className={classes.root}>
|
||||
<Grid container sx={{marginBlock: 3}} justifyContent='center'>
|
||||
<Pagination size='small' page={paj} count={pajTotal} color='primary' onChange={handleChange} />
|
||||
</div>
|
||||
</StyledGrid>
|
||||
</Grid>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user