mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-08 08:39:03 +02:00
d03ae68294
Tearing down of old Editor (Settings) GitOrigin-RevId: d9e23e61a8e34eb22e9c9e3453a157fb275f68f0
24 lines
793 B
TypeScript
24 lines
793 B
TypeScript
import ToggleSetting from '../toggle-setting'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useDetachCompileContext as useCompileContext } from '@/shared/context/detach-compile-context'
|
|
import { useSetCompilationSettingWithEvent } from '@/features/editor-left-menu/hooks/use-set-compilation-setting'
|
|
|
|
export default function AutoCompileSetting() {
|
|
const { autoCompile, setAutoCompile } = useCompileContext()
|
|
const { t } = useTranslation()
|
|
const changeAutoCompile = useSetCompilationSettingWithEvent(
|
|
'auto-compile',
|
|
setAutoCompile
|
|
)
|
|
|
|
return (
|
|
<ToggleSetting
|
|
id="autoCompile"
|
|
label={t('autocompile')}
|
|
description={t('automatically_recompile_the_project_as_you_edit')}
|
|
checked={autoCompile}
|
|
onChange={changeAutoCompile}
|
|
/>
|
|
)
|
|
}
|