import { useCallback } from 'react' import { Trans, useTranslation } from 'react-i18next' import OLButton from '@/features/ui/components/ol/ol-button' import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context' import { useStopOnFirstError } from '../../../shared/hooks/use-stop-on-first-error' import MaterialIcon from '@/shared/components/material-icon' import PdfLogEntry from '@/features/pdf-preview/components/pdf-log-entry' function PreviewLogsPaneMaxEntries({ totalEntries, entriesShown, hasErrors, }: { totalEntries: number entriesShown: number hasErrors?: boolean }) { const { t } = useTranslation() const title = t('log_entry_maximum_entries_title', { total: totalEntries, displayed: entriesShown, }) return ( } /> ) } function PreviewLogsPaneMaxEntriesContent({ hasErrors, }: { hasErrors?: boolean }) { const { t } = useTranslation() const { startCompile, stoppedOnFirstError, setAnimateCompileDropdownArrow } = useCompileContext() const { enableStopOnFirstError } = useStopOnFirstError({ eventSource: 'too-many-logs', }) const handleEnableStopOnFirstErrorClick = useCallback(() => { enableStopOnFirstError() startCompile({ stopOnFirstError: true }) setAnimateCompileDropdownArrow(true) }, [enableStopOnFirstError, startCompile, setAnimateCompileDropdownArrow]) if (hasErrors && !stoppedOnFirstError) { return ( <>

  {t('tip')}: , // eslint-disable-next-line jsx-a11y/anchor-has-content , ]} />{' '}

{t('log_entry_maximum_entries_see_full_logs')}

) } return (

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

) } export default PreviewLogsPaneMaxEntries