Add Edit component to Titre & Article

This commit is contained in:
2024-05-20 14:48:52 +04:00
parent 2d527568a8
commit 219abf5c6b
3 changed files with 22 additions and 9 deletions
+8 -2
View File
@@ -1,15 +1,21 @@
import PropTypes from 'prop-types'
import Box from '@mui/material/Box'
import Typography from '@mui/material/Typography'
import Edit from './edit.js'
export default function Titre({titre}) {
export default function Titre({session, titreId, titre}) {
return (
<Box p={1} marginBlock={1}>
<Box p={1} marginBlock={1} sx={{display: 'flex', alignItems: 'center'}}>
<Typography sx={{textDecoration: 'underline'}} fontWeight='bold'>{titre}</Typography>
{session && (
<Edit session={session} titre={titreId} />
)}
</Box>
)
}
Titre.propTypes = {
session: PropTypes.object,
titreId: PropTypes.string.isRequired,
titre: PropTypes.string.isRequired
}