'use client' import PropTypes from 'prop-types' import Box from '@mui/material/Box' import SpeedDial from '@mui/material/SpeedDial' import SpeedDialIcon from '@mui/material/SpeedDialIcon' import SpeedDialAction from '@mui/material/SpeedDialAction' import ArticleIcon from '@mui/icons-material/Article' import TitleIcon from '@mui/icons-material/Title' import {useState} from 'react' import HandleCreate from './handle-create.js' import AuthAlert from '@/components/auth-form/auth-alert.js' const actions = [ {id: 'titres', icon: , name: 'Créer un titre'}, {id: 'articles', icon: , name: 'Créer un article'} ] export default function Create({session}) { const [collection, setCollection] = useState(null) const [isDialogOpen, setIsDialogOpen] = useState(false) const [isErrorAlertOpen, setIsErrorAlertOpen] = useState(false) const [isSuccessAlertOpen, setIsSuccessAlertOpen] = useState(false) const [error, setError] = useState('') const [success, setSuccess] = useState('') const handleTitresDialog = collection => { setCollection(collection) setIsDialogOpen(true) } return ( <> {error && } {success && } } > {actions.map(({id, icon, name}) => ( handleTitresDialog(id)} /> ))} {collection && ( )} ) } Create.propTypes = { session: PropTypes.object }