overleaf/services/web/frontend/js/features/editor-left-menu/components/actions-menu.tsx
Jakob Ackermann aa480a2663 Merge pull request #18898 from overleaf/jpa-no-window
[web] migrate from window attributes to getMeta

GitOrigin-RevId: 3dcf1ab6b01155e5e4abeb3e78d0fa9053e055bc
2024-06-19 08:04:21 +00:00

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>
</>
)
}