mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-10 14:40:47 +02:00
975d1ee250
Add copy and submit project options to new editor file menu GitOrigin-RevId: 7f402d96f278f2b084375441089b286adaa731b8
31 lines
989 B
TypeScript
31 lines
989 B
TypeScript
import { useCallback, useState } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import EditorCloneProjectModalWrapper from '../../clone-project-modal/components/editor-clone-project-modal-wrapper'
|
|
import LeftMenuButton from './left-menu-button'
|
|
import * as eventTracking from '../../../infrastructure/event-tracking'
|
|
import useOpenProject from '@/shared/hooks/use-open-project'
|
|
|
|
export default function ActionsCopyProject() {
|
|
const [showModal, setShowModal] = useState(false)
|
|
const { t } = useTranslation()
|
|
const openProject = useOpenProject()
|
|
|
|
const handleShowModal = useCallback(() => {
|
|
eventTracking.sendMB('left-menu-copy')
|
|
setShowModal(true)
|
|
}, [])
|
|
|
|
return (
|
|
<>
|
|
<LeftMenuButton onClick={handleShowModal} icon="file_copy">
|
|
{t('copy_project')}
|
|
</LeftMenuButton>
|
|
<EditorCloneProjectModalWrapper
|
|
show={showModal}
|
|
handleHide={() => setShowModal(false)}
|
|
openProject={openProject}
|
|
/>
|
|
</>
|
|
)
|
|
}
|