mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
[web] Consolidate ide settings in `features/ide-settings` GitOrigin-RevId: cbf0ff069399f418d8cb0d8165628df190046ea9
24 lines
789 B
TypeScript
24 lines
789 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/ide-settings/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}
|
|
/>
|
|
)
|
|
}
|