Files
pawol.nu/components/awtis/pajinasyon.js
T

27 lines
685 B
JavaScript
Raw Normal View History

2023-07-22 13:45:55 +04:00
'use client'
2020-12-11 01:39:21 +01:00
import PropTypes from 'prop-types'
2023-07-22 13:45:55 +04:00
import {useRouter} from 'next/navigation'
2022-01-19 07:06:26 +04:00
import Pagination from '@mui/material/Pagination'
2023-07-22 13:45:55 +04:00
import Grid from '@mui/material/Unstable_Grid2'
2020-12-11 01:39:21 +01:00
export default function Pajinasyon({pajTotal, paj}) {
const router = useRouter()
2022-01-19 06:35:04 +04:00
2020-12-11 01:39:21 +01:00
const handleChange = (event, value) => {
2023-07-22 13:45:55 +04:00
const href = `/awtis?paj=${value}`
router.push(href)
2020-12-11 01:39:21 +01:00
}
return (
2023-07-22 13:45:55 +04:00
<Grid container sx={{marginBlock: 3}} justifyContent='center'>
<Pagination size='small' page={paj} count={pajTotal} color='primary' onChange={handleChange} />
</Grid>
2020-12-11 01:39:21 +01:00
)
}
Pajinasyon.propTypes = {
pajTotal: PropTypes.number.isRequired,
paj: PropTypes.number.isRequired
}