Files
konstitisyon.nu/components/konstitisyon/edit/titre.js
T

22 lines
658 B
JavaScript
Raw Normal View History

2024-05-18 09:36:44 +04:00
import PropTypes from 'prop-types'
import Box from '@mui/material/Box'
import Typography from '@mui/material/Typography'
2024-07-06 16:41:34 +02:00
import Edit from './index.js'
2024-05-18 09:36:44 +04:00
2024-07-06 16:41:34 +02:00
export default function Titre({session, titreId, contenu}) {
2024-05-18 09:36:44 +04:00
return (
2024-05-20 14:48:52 +04:00
<Box p={1} marginBlock={1} sx={{display: 'flex', alignItems: 'center'}}>
2024-07-06 16:41:34 +02:00
<Typography sx={{textDecoration: 'underline'}} fontWeight='bold'>{contenu}</Typography>
2024-05-20 14:48:52 +04:00
{session && (
2024-07-06 16:41:34 +02:00
<Edit session={session} id={titreId} contenu={contenu} collection='titres' />
2024-05-20 14:48:52 +04:00
)}
2024-05-18 09:36:44 +04:00
</Box>
)
}
Titre.propTypes = {
2024-05-20 14:48:52 +04:00
session: PropTypes.object,
titreId: PropTypes.string.isRequired,
2024-07-06 16:41:34 +02:00
contenu: PropTypes.string.isRequired
2024-05-18 09:36:44 +04:00
}