import { Button, Dropdown, MenuItem } from 'react-bootstrap' import Icon from '../../../shared/components/icon' import ControlledDropdown from '../../../shared/components/controlled-dropdown' import { useTranslation } from 'react-i18next' import { usePdfPreviewContext } from '../contexts/pdf-preview-context' import { memo, useCallback } from 'react' import classnames from 'classnames' function PdfCompileButton() { const { autoCompile, compiling, draft, hasChanges, recompile, setAutoCompile, setDraft, setStopOnValidationError, stopCompile, stopOnValidationError, recompileFromScratch, } = usePdfPreviewContext() const { t } = useTranslation() const compileButtonLabel = compiling ? t('compiling') + '…' : t('recompile') const startCompile = useCallback(() => { recompile() }, [recompile]) return ( {t('auto_compile')} setAutoCompile(true)}> {t('on')} setAutoCompile(false)}> {t('off')} {t('compile_mode')} setDraft(false)}> {t('normal')} setDraft(true)}> {t('fast')} [draft] Syntax Checks setStopOnValidationError(true)}> {t('stop_on_validation_error')} setStopOnValidationError(false)}> {t('ignore_validation_errors')} {t('stop_compile')} {t('recompile_from_scratch')} ) } export default memo(PdfCompileButton)