Files
konstitisyon.nu/components/versions/version-comparison.js
T

93 lines
2.7 KiB
JavaScript
Raw Normal View History

import Box from '@mui/material/Box'
import Typography from '@mui/material/Typography'
import Paper from '@mui/material/Paper'
import Grid from '@mui/material/Grid2'
import PropTypes from 'prop-types'
export default function VersionComparison({versionData}) {
const {current, main, outdated} = versionData
return (
<Box sx={{padding: 3}}>
<Grid container spacing={2}>
<Grid xs={6}>
2024-12-03 11:51:29 +04:00
<Paper sx={{padding: 1, backgroundColor: '#E8F5E9'}}>
<Typography variant='body1' sx={{color: '#388E3C', fontWeight: 'bold'}}>
{main.contenu}
</Typography>
</Paper>
</Grid>
<Grid xs={6}>
2024-12-03 11:51:29 +04:00
<Paper sx={{padding: 1, backgroundColor: outdated ? '#F9E8E8' : '#E3F2FD'}}>
<Typography variant='body1' sx={{color: outdated ? '#D32F2F' : '#1976D2', fontWeight: 'bold'}}>
{current.contenu}
</Typography>
</Paper>
</Grid>
</Grid>
<Box sx={{marginTop: 4}}>
2024-12-03 11:51:29 +04:00
<Typography variant='button' sx={{
fontWeight: 'bold', marginBottom: 1, textAlign: 'center', display: 'block'
}}
>
LÉGENDE
</Typography>
2024-12-03 11:51:29 +04:00
<Grid container textAlign='center' spacing={2}>
2024-12-03 19:12:15 +04:00
<Grid size={{xs: 12, sm: 4}}>
2024-12-03 11:51:29 +04:00
<Typography
variant='body2'
sx={{
backgroundColor: '#E8F5E9',
padding: 1,
borderRadius: 1,
color: '#388E3C',
fontWeight: 'bold'
}}
>
2024-12-03 19:12:15 +04:00
En ligne
2024-12-03 11:51:29 +04:00
</Typography>
</Grid>
2024-12-03 19:12:15 +04:00
<Grid size={{xs: 12, sm: 4}}>
2024-12-03 11:51:29 +04:00
<Typography
variant='body2'
sx={{
backgroundColor: '#E3F2FD',
padding: 1,
borderRadius: 1,
color: '#1976D2',
fontWeight: 'bold'
}}
>
2024-12-03 19:12:15 +04:00
En cours de révision
2024-12-03 11:51:29 +04:00
</Typography>
</Grid>
2024-12-03 19:12:15 +04:00
<Grid size={{xs: 12, sm: 4}}>
2024-12-03 11:51:29 +04:00
<Typography
variant='body2'
sx={{
backgroundColor: '#F9E8E8',
padding: 1,
borderRadius: 1,
color: '#D32F2F',
fontWeight: 'bold'
}}
>
2024-12-03 19:12:15 +04:00
Remplacée
2024-12-03 11:51:29 +04:00
</Typography>
</Grid>
</Grid>
</Box>
</Box>
)
}
VersionComparison.propTypes = {
versionData: PropTypes.shape({
outdated: PropTypes.bool.isRequired,
mainHash: PropTypes.string.isRequired,
current: PropTypes.object.isRequired,
main: PropTypes.object.isRequired,
}).isRequired,
}