overleaf/services/web/frontend/js/features/pdf-preview/components/stop-on-first-error-prompt.js
Eric Mc Sween cb657d1f1c Merge pull request #8297 from overleaf/em-halt-on-error-logs
Stop on first error info box in logs pane

GitOrigin-RevId: cf11f65d582d98bea93c6506393940d9a6144c0d
2022-06-08 08:03:12 +00:00

34 lines
1 KiB
JavaScript

import { useTranslation, Trans } from 'react-i18next'
import { Button } from 'react-bootstrap'
import PdfLogEntry from './pdf-log-entry'
import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
export default function StopOnFirstErrorPrompt() {
const { t } = useTranslation()
const { setStopOnFirstError, startCompile } = useCompileContext()
return (
<PdfLogEntry
headerTitle={t('stop_on_first_error_enabled_title')}
formattedContent={
<>
<Trans
i18nKey="stop_on_first_error_enabled_description"
// eslint-disable-next-line react/jsx-key
components={[<strong />]}
/>{' '}
<Button
bsSize="xs"
bsStyle="info"
onClick={() => {
startCompile({ stopOnFirstError: false })
setStopOnFirstError(false)
}}
>
{t('disable_stop_on_first_error')}
</Button>
</>
}
level="info"
/>
)
}