mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 15:30:50 -05:00
aa480a2663
[web] migrate from window attributes to getMeta GitOrigin-RevId: 3dcf1ab6b01155e5e4abeb3e78d0fa9053e055bc
39 lines
994 B
TypeScript
39 lines
994 B
TypeScript
import { ElementType } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import getMeta from '../../../utils/meta'
|
|
import importOverleafModules from '../../../../macros/import-overleaf-module.macro'
|
|
import ActionsCopyProject from './actions-copy-project'
|
|
import ActionsWordCount from './actions-word-count'
|
|
|
|
const components = importOverleafModules('editorLeftMenuManageTemplate') as {
|
|
import: { default: ElementType }
|
|
path: string
|
|
}[]
|
|
|
|
export default function ActionsMenu() {
|
|
const { t } = useTranslation()
|
|
const anonymous = getMeta('ol-anonymous')
|
|
|
|
if (anonymous) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<h4>{t('actions')}</h4>
|
|
<ul className="list-unstyled nav">
|
|
<li>
|
|
<ActionsCopyProject />
|
|
</li>
|
|
{components.map(({ import: { default: Component }, path }) => (
|
|
<li key={path}>
|
|
<Component />
|
|
</li>
|
|
))}
|
|
<li>
|
|
<ActionsWordCount />
|
|
</li>
|
|
</ul>
|
|
</>
|
|
)
|
|
}
|