|
|
@@ -2,6 +2,9 @@ import { memo, useCallback } from 'react'
|
|
|
import PropTypes from 'prop-types'
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
import PreviewLogsPaneEntry from '../../preview/components/preview-logs-pane-entry'
|
|
|
+import PreviewLogsPaneMaxEntries from '../../preview/components/preview-logs-pane-max-entries'
|
|
|
+
|
|
|
+const LOG_PREVIEW_LIMIT = 100
|
|
|
|
|
|
function PdfLogsEntries({ entries }) {
|
|
|
const { t } = useTranslation()
|
|
|
@@ -14,9 +17,18 @@ function PdfLogsEntries({ entries }) {
|
|
|
)
|
|
|
}, [])
|
|
|
|
|
|
+ const logEntries = entries.slice(0, LOG_PREVIEW_LIMIT)
|
|
|
+
|
|
|
return (
|
|
|
<>
|
|
|
- {entries.map(logEntry => (
|
|
|
+ {entries.length > LOG_PREVIEW_LIMIT && (
|
|
|
+ <PreviewLogsPaneMaxEntries
|
|
|
+ key={`${entries.length}-${LOG_PREVIEW_LIMIT}`}
|
|
|
+ totalEntries={entries.length}
|
|
|
+ entriesShown={LOG_PREVIEW_LIMIT}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {logEntries.map(logEntry => (
|
|
|
<PreviewLogsPaneEntry
|
|
|
key={logEntry.key}
|
|
|
headerTitle={logEntry.message}
|