refactor: improve HandleCreate
This commit is contained in:
@@ -11,7 +11,7 @@ import Tooltip, {tooltipClasses} from '@mui/material/Tooltip'
|
||||
import AuthAlert from '../auth-form/auth-alert.js'
|
||||
import Titre from './titre.js'
|
||||
import Article from './article.js'
|
||||
import HandleComments from './comments/handle-comments.js'
|
||||
import HandleCreate from './create/handle-create.js'
|
||||
import {formatKonstitisyon} from '@/lib/format.js'
|
||||
|
||||
const LightTooltip = styled(({className, ...props}) => (
|
||||
@@ -84,8 +84,8 @@ export default function Konstitisyon({session, titres, articles}) {
|
||||
)}
|
||||
</Paper>
|
||||
))}
|
||||
{selectedTitre && (
|
||||
<HandleComments
|
||||
{selectedTitre && operation === 'create' && (
|
||||
<HandleCreate
|
||||
session={session}
|
||||
selectedTitre={selectedTitre}
|
||||
isOpen={isDialogOpen}
|
||||
@@ -94,7 +94,7 @@ export default function Konstitisyon({session, titres, articles}) {
|
||||
setSuccess={setSuccess}
|
||||
setIsErrorAlertOpen={setIsErrorAlertOpen}
|
||||
setIsSuccessAlertOpen={setIsSuccessAlertOpen}
|
||||
operation={operation}
|
||||
collection='commentaires'
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user