Create Konstitisyon components

This commit is contained in:
2024-05-18 09:36:44 +04:00
parent 182656bf98
commit a13bc564a9
3 changed files with 65 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import PropTypes from 'prop-types'
import Box from '@mui/material/Box'
import Typography from '@mui/material/Typography'
export default function Article({numero, contenu}) {
const formattedContent = contenu.replaceAll('\n', '<br />')
return (
<Box textAlign='justify' p={0.5}>
{numero > 0 && (
<Typography marginBlock={1} fontWeight='bold'>Article {numero}</Typography>
)}
<Typography dangerouslySetInnerHTML={{__html: formattedContent}} />
</Box>
)
}
Article.propTypes = {
numero: PropTypes.number,
contenu: PropTypes.string.isRequired
}