Files
pawol.nu/components/kat-kay-la.js
T
Cédric FAMIBELLE-PRONZOLA ae966882d1 Replace Button by Box in index
2022-01-22 14:49:46 +04:00

34 lines
770 B
JavaScript

import PropTypes from 'prop-types'
import {useRouter} from 'next/router'
import {
Grid,
Box
} from '@mui/material'
export default function KatKayLa({tit, kantite, route}) {
const router = useRouter()
return (
<Grid item sx={{marginTop: 1}}>
<Box sx={{
width: 100,
padding: 1,
border: '1px solid rgba(76, 175, 80, 0.5)',
color: 'rgb(76, 175, 80)',
borderRadius: '4px',
textAlign: 'center',
cursor: 'pointer'
}} onClick={() => router.push(route).then(() => window.scrollTo(0, 0))}
>
{kantite} <br /> {tit}
</Box>
</Grid>
)
}
KatKayLa.propTypes = {
tit: PropTypes.string.isRequired,
kantite: PropTypes.number.isRequired,
route: PropTypes.string.isRequired
}