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 21:49:02 +04:00
|
|
|
import {Button, CardActionArea, CardActions, CardMedia, Divider, Grid} from '@mui/material'
|
2022-02-02 07:33:52 +04:00
|
|
|
import Typography from '@mui/material/Typography'
|
2022-02-08 21:49:02 +04:00
|
|
|
import RezoImaj from './rezo-imaj'
|
|
|
|
|
|
|
|
|
|
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
|
|
|
<>
|
|
|
|
|
<Grid item xs={12} md={6} sx={{marginBottom: 3}}>
|
|
|
|
|
<Card raised>
|
|
|
|
|
<CardActionArea onClick={handleClickOpen}>
|
|
|
|
|
<CardMedia
|
|
|
|
|
sx={{objectFit: 'contain'}}
|
|
|
|
|
component='img'
|
|
|
|
|
height='150'
|
|
|
|
|
image={`/captures/${img}.png`}
|
|
|
|
|
alt={`Aperçu ${tit}`}
|
|
|
|
|
title='Cliquez pour agrandir'
|
|
|
|
|
/>
|
|
|
|
|
</CardActionArea>
|
|
|
|
|
<Divider />
|
2022-02-02 07:33:52 +04:00
|
|
|
<CardContent>
|
|
|
|
|
<Typography color='primary' variant='button' sx={{fontSize: 25}}>
|
|
|
|
|
{tit}
|
|
|
|
|
</Typography>
|
|
|
|
|
<Typography variant='h6' component='div'>
|
|
|
|
|
{soutit}
|
|
|
|
|
</Typography>
|
|
|
|
|
<Typography variant='body2'>
|
|
|
|
|
{ko}
|
|
|
|
|
</Typography>
|
|
|
|
|
</CardContent>
|
2022-02-08 21:49:02 +04:00
|
|
|
<CardActions sx={{textAlign: 'center'}}>
|
|
|
|
|
<Button variant='outlined' size='small' color='primary' onClick={() => window.open(lyen, '_blank')}>
|
|
|
|
|
Accéder à {tit}
|
|
|
|
|
</Button>
|
|
|
|
|
</CardActions>
|
|
|
|
|
</Card>
|
|
|
|
|
</Grid>
|
|
|
|
|
<RezoImaj img={img} open={open} setOpen={setOpen} />
|
|
|
|
|
</>
|
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
|
|
|
|
|
}
|