import { useTranslation } from 'react-i18next' import FileTreeCreateNewDoc from './modes/file-tree-create-new-doc' import FileTreeImportFromUrl from './modes/file-tree-import-from-url' import FileTreeImportFromProject from './modes/file-tree-import-from-project' import FileTreeModalCreateFileMode from './file-tree-modal-create-file-mode' import FileTreeCreateNameProvider from '../../contexts/file-tree-create-name' import { useFileTreeActionable } from '../../contexts/file-tree-actionable' import { useFileTreeData } from '../../../../shared/context/file-tree-data-context' import importOverleafModules from '../../../../../macros/import-overleaf-module.macro' import { lazy, Suspense } from 'react' import { FullSizeLoadingSpinner } from '@/shared/components/loading-spinner' import getMeta from '@/utils/meta' import { bsVersion } from '@/features/utils/bootstrap-5' const createFileModeModules = importOverleafModules('createFileModes') const FileTreeUploadDoc = lazy(() => import('./modes/file-tree-upload-doc')) export default function FileTreeModalCreateFileBody() { const { t } = useTranslation() const { newFileCreateMode } = useFileTreeActionable() const { fileCount } = useFileTreeData() const { hasLinkedProjectFileFeature, hasLinkedProjectOutputFileFeature, hasLinkUrlFeature, } = getMeta('ol-ExposedSettings') if (!fileCount || fileCount.status === 'error') { return null } return (
    {(hasLinkedProjectFileFeature || hasLinkedProjectOutputFileFeature) && ( )} {hasLinkUrlFeature && ( )} {createFileModeModules.map( ({ import: { CreateFileMode }, path }) => ( ) )}
{newFileCreateMode === 'doc' && ( )} {newFileCreateMode === 'url' && ( )} {newFileCreateMode === 'project' && ( )} {newFileCreateMode === 'upload' && ( }> )} {createFileModeModules.map( ({ import: { CreateFilePane }, path }) => ( ) )}
) }