mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
* Merge intermediate component wrappers into OL-prefixed components * Replace all intermediate wrapper consumers with OL-prefixed components directly * Fix jsx/js files still importing deleted shim components * Remove duplicate OLNotification imports left by first pass * Rename OLTagIcon to TagIcon, remove OL prefix * Rename OLDropdownMenuItem to DropdownMenuItem, remove OL prefix * Remove OLNotification, use Notification directly * Move Notification to the main shared component folder * Update tag-icon import path out of ol/ * Move TagIcon to the main shared component folder * Update dropdown-menu-item import path out of ol/ * Move DropdownMenuItem to the main shared component folder * Fix dropdown-menu-item import path to dropdown/ subfolder * Remove BS5 alias prefixes from shared components * Restore notification-list wrapper in Notification component * Add translation for loading button * Remove redundant import aliasing * Resolve conflicts * Restore notification container `notification-list` GitOrigin-RevId: 24a5af18599a3e02ac6fd61c09cf5a49ef6e0020
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import EditorCloneProjectModalWrapper from '@/features/clone-project-modal/components/editor-clone-project-modal-wrapper'
|
|
import DropdownMenuItem from '@/shared/components/dropdown/dropdown-menu-item'
|
|
import { useEditorAnalytics } from '@/shared/hooks/use-editor-analytics'
|
|
import useOpenProject from '@/shared/hooks/use-open-project'
|
|
import getMeta from '@/utils/meta'
|
|
import { useCallback, useState } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
export const DuplicateProject = () => {
|
|
const { sendEvent } = useEditorAnalytics()
|
|
const { t } = useTranslation()
|
|
const [showModal, setShowModal] = useState(false)
|
|
const anonymous = getMeta('ol-anonymous')
|
|
const openProject = useOpenProject()
|
|
|
|
const handleShowModal = useCallback(() => {
|
|
sendEvent('copy-project', { location: 'project-title-dropdown' })
|
|
setShowModal(true)
|
|
}, [sendEvent])
|
|
|
|
if (anonymous) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<DropdownMenuItem onClick={handleShowModal}>
|
|
{t('make_a_copy')}
|
|
</DropdownMenuItem>
|
|
<EditorCloneProjectModalWrapper
|
|
show={showModal}
|
|
handleHide={() => setShowModal(false)}
|
|
openProject={openProject}
|
|
/>
|
|
</>
|
|
)
|
|
}
|