refactor: Improve edit components

This commit is contained in:
2024-07-06 16:41:34 +02:00
parent 79cc1c0dd8
commit 3ec2944189
4 changed files with 22 additions and 18 deletions
+21
View File
@@ -0,0 +1,21 @@
import PropTypes from 'prop-types'
import Box from '@mui/material/Box'
import Typography from '@mui/material/Typography'
import Edit from './index.js'
export default function Titre({session, titreId, contenu}) {
return (
<Box p={1} marginBlock={1} sx={{display: 'flex', alignItems: 'center'}}>
<Typography sx={{textDecoration: 'underline'}} fontWeight='bold'>{contenu}</Typography>
{session && (
<Edit session={session} id={titreId} contenu={contenu} collection='titres' />
)}
</Box>
)
}
Titre.propTypes = {
session: PropTypes.object,
titreId: PropTypes.string.isRequired,
contenu: PropTypes.string.isRequired
}