import PropTypes from 'prop-types' import { Trans, useTranslation } from 'react-i18next' import { Button } from 'react-bootstrap' import PreviewLogEntryHeader from './preview-log-entry-header' import Icon from '../../../shared/components/icon' import getMeta from '../../../utils/meta' import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context' function PreviewLogsPaneMaxEntries({ totalEntries, entriesShown, hasErrors }) { const { t } = useTranslation() const showStopOnFirstError = getMeta('ol-showStopOnFirstError') const { startCompile, setStopOnFirstError, stoppedOnFirstError } = useCompileContext() const title = t('log_entry_maximum_entries_title', { total: totalEntries, displayed: entriesShown, }) return (
{showStopOnFirstError ? ( hasErrors && !stoppedOnFirstError ? ( <>

  {t('tip')}: { startCompile({ stopOnFirstError: true }) setStopOnFirstError(true) }} /> ), 'learn-more-link': ( // eslint-disable-next-line jsx-a11y/anchor-has-content ), }} />

{t('log_entry_maximum_entries_see_full_logs')}

) : (

  {t('tip')}: {t('log_entry_maximum_entries_see_full_logs')}

) ) : ( <>   {hasErrors ? ( ,

]} // eslint-disable-line react/jsx-key /> ) : ( ]} // eslint-disable-line react/jsx-key /> )} )}

) } PreviewLogsPaneMaxEntries.propTypes = { totalEntries: PropTypes.number, entriesShown: PropTypes.number, hasErrors: PropTypes.bool, } export default PreviewLogsPaneMaxEntries