2023-03-20 09:58:46 -04:00
|
|
|
import { ElementType } from 'react'
|
2022-10-27 12:19:50 -04:00
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import getMeta from '../../../utils/meta'
|
2023-03-20 09:58:46 -04:00
|
|
|
import importOverleafModules from '../../../../macros/import-overleaf-module.macro'
|
2022-10-27 12:19:50 -04:00
|
|
|
import ActionsCopyProject from './actions-copy-project'
|
|
|
|
import ActionsWordCount from './actions-word-count'
|
|
|
|
|
2023-03-20 09:58:46 -04:00
|
|
|
const components = importOverleafModules('editorLeftMenuManageTemplate') as {
|
|
|
|
import: { default: ElementType }
|
|
|
|
path: string
|
|
|
|
}[]
|
|
|
|
|
2022-10-27 12:19:50 -04:00
|
|
|
export default function ActionsMenu() {
|
|
|
|
const { t } = useTranslation()
|
2024-06-18 06:01:37 -04:00
|
|
|
const anonymous = getMeta('ol-anonymous')
|
2022-10-27 12:19:50 -04:00
|
|
|
|
2024-06-18 06:01:37 -04:00
|
|
|
if (anonymous) {
|
2022-10-27 12:19:50 -04:00
|
|
|
return null
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<h4>{t('actions')}</h4>
|
|
|
|
<ul className="list-unstyled nav">
|
|
|
|
<li>
|
|
|
|
<ActionsCopyProject />
|
|
|
|
</li>
|
2023-03-20 09:58:46 -04:00
|
|
|
{components.map(({ import: { default: Component }, path }) => (
|
|
|
|
<li key={path}>
|
|
|
|
<Component />
|
|
|
|
</li>
|
|
|
|
))}
|
2022-10-27 12:19:50 -04:00
|
|
|
<li>
|
|
|
|
<ActionsWordCount />
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|