mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 21:31:36 +02:00
Tearing down of old Editor (Settings) GitOrigin-RevId: d9e23e61a8e34eb22e9c9e3453a157fb275f68f0
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import { useProjectSettingsContext } from '@/features/editor-left-menu/context/project-settings-context'
|
|
import DropdownSetting from '../dropdown-setting'
|
|
import type { Option } from '../dropdown-setting'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { usePermissionsContext } from '@/features/ide-react/context/permissions-context'
|
|
import { ProjectCompiler } from '@ol-types/project-settings'
|
|
import { useSetCompilationSettingWithEvent } from '@/features/editor-left-menu/hooks/use-set-compilation-setting'
|
|
|
|
const OPTIONS: Option<ProjectCompiler>[] = [
|
|
{
|
|
value: 'pdflatex',
|
|
label: 'pdfLaTeX',
|
|
},
|
|
{
|
|
value: 'latex',
|
|
label: 'LaTeX',
|
|
},
|
|
{
|
|
value: 'xelatex',
|
|
label: 'XeLaTeX',
|
|
},
|
|
{
|
|
value: 'lualatex',
|
|
label: 'LuaLaTeX',
|
|
},
|
|
]
|
|
|
|
export default function CompilerSetting() {
|
|
const { compiler, setCompiler } = useProjectSettingsContext()
|
|
const { t } = useTranslation()
|
|
const { write } = usePermissionsContext()
|
|
const changeCompiler = useSetCompilationSettingWithEvent(
|
|
'compiler',
|
|
setCompiler
|
|
)
|
|
|
|
return (
|
|
<DropdownSetting
|
|
id="compiler"
|
|
label={t('compiler')}
|
|
description={t('the_latex_engine_used_for_compiling')}
|
|
disabled={!write}
|
|
options={OPTIONS}
|
|
onChange={changeCompiler}
|
|
value={compiler}
|
|
translateOptions="no"
|
|
/>
|
|
)
|
|
}
|