Files
pawol.nu/components/akey/kat-akey.js
T

40 lines
1.2 KiB
JavaScript
Raw Normal View History

2023-07-22 13:37:27 +04:00
'use client'
2020-12-17 22:34:55 +01:00
import PropTypes from 'prop-types'
2023-07-22 13:37:27 +04:00
import {useRouter} from 'next/navigation'
import {useTheme} from '@mui/material/styles'
2024-10-21 09:55:57 +04:00
import Grid from '@mui/material/Grid2'
2022-05-25 06:38:05 +04:00
import Card from '@mui/material/Card'
import CardActionArea from '@mui/material/CardActionArea'
import CardContent from '@mui/material/CardContent'
import Typography from '@mui/material/Typography'
2022-05-23 00:24:49 +04:00
2023-07-22 13:37:27 +04:00
export default function KatAkey({tit, kantite, href, as}) {
const theme = useTheme()
const rute = useRouter()
2020-12-17 22:34:55 +01:00
return (
2023-07-22 13:37:27 +04:00
<Grid xs={12} md={6}>
<Card sx={{borderColor: theme.palette.primary[theme.palette.mode]}} color='primary' variant='outlined'>
<CardActionArea onClick={() => rute.push(href, as)}>
2022-05-23 00:24:49 +04:00
<CardContent>
2022-05-25 06:38:05 +04:00
<Typography style={{fontWeight: 'bold'}} align='center' variant='h5' component='h4'>
2022-05-23 00:24:49 +04:00
{kantite}
</Typography>
2022-05-25 06:38:05 +04:00
<Typography align='center' variant='h6' component='h5'>
2022-05-23 03:28:30 +04:00
{tit}
</Typography>
2022-05-23 00:24:49 +04:00
</CardContent>
</CardActionArea>
</Card>
2022-05-25 06:38:05 +04:00
</Grid>
2020-12-17 22:34:55 +01:00
)
}
2023-07-22 13:37:27 +04:00
KatAkey.propTypes = {
2020-12-17 22:34:55 +01:00
tit: PropTypes.string.isRequired,
2020-12-18 22:01:47 +01:00
kantite: PropTypes.number.isRequired,
2022-05-23 00:24:49 +04:00
href: PropTypes.string.isRequired,
as: PropTypes.string.isRequired
2020-12-17 22:34:55 +01:00
}