2021-10-06 04:33:18 -04:00
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import { Trans, useTranslation } from 'react-i18next'
|
|
|
|
import PreviewLogEntryHeader from './preview-log-entry-header'
|
|
|
|
import Icon from '../../../shared/components/icon'
|
|
|
|
|
2021-11-25 05:24:25 -05:00
|
|
|
function PreviewLogsPaneMaxEntries({ totalEntries, entriesShown, hasErrors }) {
|
2021-10-06 04:33:18 -04:00
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
const title = t('log_entry_maximum_entries_title', {
|
|
|
|
total: totalEntries,
|
|
|
|
displayed: entriesShown,
|
|
|
|
})
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="log-entry" aria-label={t('log_entry_maximum_entries')}>
|
|
|
|
<PreviewLogEntryHeader level="raw" headerTitle={title} />
|
|
|
|
<div className="log-entry-content">
|
2022-01-19 06:56:57 -05:00
|
|
|
<Icon type="lightbulb-o" />
|
|
|
|
|
2021-11-25 05:24:25 -05:00
|
|
|
{hasErrors ? (
|
|
|
|
<Trans
|
|
|
|
i18nKey="log_entry_maximum_entries_message"
|
|
|
|
components={[<b key="bold-1" />, <p />]} // eslint-disable-line react/jsx-key
|
|
|
|
/>
|
|
|
|
) : (
|
|
|
|
<Trans
|
|
|
|
i18nKey="log_entry_maximum_entries_message_no_errors"
|
|
|
|
components={[<b key="bold-1" />]}
|
|
|
|
/>
|
|
|
|
)}
|
2021-10-06 04:33:18 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
PreviewLogsPaneMaxEntries.propTypes = {
|
|
|
|
totalEntries: PropTypes.number,
|
|
|
|
entriesShown: PropTypes.number,
|
2021-11-25 05:24:25 -05:00
|
|
|
hasErrors: PropTypes.bool,
|
2021-10-06 04:33:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export default PreviewLogsPaneMaxEntries
|