stop-on-first-error-prompt.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { useTranslation, Trans } from 'react-i18next'
  2. import { Button } from 'react-bootstrap'
  3. import PdfLogEntry from './pdf-log-entry'
  4. import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
  5. export default function StopOnFirstErrorPrompt() {
  6. const { t } = useTranslation()
  7. const { setStopOnFirstError, startCompile } = useCompileContext()
  8. return (
  9. <PdfLogEntry
  10. headerTitle={t('stop_on_first_error_enabled_title')}
  11. formattedContent={
  12. <>
  13. <Trans
  14. i18nKey="stop_on_first_error_enabled_description"
  15. // eslint-disable-next-line react/jsx-key
  16. components={[<strong />]}
  17. />{' '}
  18. <Button
  19. bsSize="xs"
  20. bsStyle="info"
  21. onClick={() => {
  22. startCompile({ stopOnFirstError: false })
  23. setStopOnFirstError(false)
  24. }}
  25. >
  26. {t('disable_stop_on_first_error')}
  27. </Button>
  28. </>
  29. }
  30. level="info"
  31. />
  32. )
  33. }