Add Edit component to Titre & Article
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user