Files

69 lines
2.1 KiB
JavaScript
Raw Permalink Normal View History

2022-02-08 21:49:02 +04:00
import {useState} from 'react'
2022-02-02 07:33:52 +04:00
import PropTypes from 'prop-types'
import Card from '@mui/material/Card'
import CardContent from '@mui/material/CardContent'
2022-02-08 22:23:02 +04:00
import CardActionArea from '@mui/material/CardActionArea'
import Divider from '@mui/material/Divider'
import Grid from '@mui/material/Grid'
2022-02-08 22:23:02 +04:00
2022-02-02 07:33:52 +04:00
import Typography from '@mui/material/Typography'
2022-05-08 23:46:02 +04:00
import {CardMedia} from '@mui/material'
import RezoImaj from '../rezo-imaj'
2022-02-08 21:49:02 +04:00
export default function KatRezoNou({tit, img, soutit, ko, lyen}) {
const [open, setOpen] = useState(false)
const handleClickOpen = () => {
setOpen(true)
}
2022-02-02 07:33:52 +04:00
return (
2022-02-08 21:49:02 +04:00
<>
2024-10-21 10:06:16 +04:00
<Grid size={{xs: 12, md: 6}} sx={{marginBottom: 2}}>
2022-02-08 21:49:02 +04:00
<Card raised>
<CardActionArea onClick={handleClickOpen}>
2022-05-08 23:46:02 +04:00
<CardMedia
component='img'
height='140'
image={`/captures/${img}.png`}
alt={`Aperçu ${tit}`}
/>
<CardContent>
<Typography color='primary' variant='h6' component='div'>
{tit}
</Typography>
2022-05-10 17:22:28 +04:00
<Typography gutterBottom variant='caption' component='div'>
{`${img}.o-k-i.net`}
</Typography>
2022-05-08 23:46:02 +04:00
<Typography variant='h6' component='div'>
{soutit}
</Typography>
<Typography variant='body2'>
{ko}
</Typography>
</CardContent>
2022-02-08 21:49:02 +04:00
</CardActionArea>
2022-02-09 07:18:48 +04:00
<Divider sx={{borderWidth: 1}} />
2022-05-08 23:46:02 +04:00
<CardActionArea onClick={() => window.open(lyen, '_blank')}>
<CardContent>
<Typography textAlign='center' color='primary' variant='h6' component='div'>
Accéder à {tit}
</Typography>
</CardContent>
</CardActionArea>
2022-02-08 21:49:02 +04:00
</Card>
</Grid>
2022-02-09 19:34:06 +04:00
<RezoImaj tit={tit} img={img} open={open} setOpen={setOpen} />
2022-02-08 21:49:02 +04:00
</>
2022-02-02 07:33:52 +04:00
)
}
KatRezoNou.propTypes = {
tit: PropTypes.string.isRequired,
2022-02-08 21:49:02 +04:00
img: PropTypes.string.isRequired,
2022-02-02 07:33:52 +04:00
soutit: PropTypes.string.isRequired,
ko: PropTypes.string.isRequired,
lyen: PropTypes.string.isRequired
}