mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
01cc057f6b
* Add raw logs to new compile UI * Address feedback * Update test/frontend/features/preview/components/preview-logs-pane.test.js Co-authored-by: John Lees-Miller <jdleesmiller@gmail.com> Co-authored-by: John Lees-Miller <jdleesmiller@gmail.com> GitOrigin-RevId: af9c653e13d93434467b122f4c388493e786212c
34 lines
886 B
JavaScript
34 lines
886 B
JavaScript
import React from 'react'
|
|
import PropTypes from 'prop-types'
|
|
import { useTranslation } from 'react-i18next'
|
|
import PreviewLogEntry from './preview-log-entry'
|
|
|
|
function PreviewLogsPane({ logEntries, rawLog, onLogEntryLocationClick }) {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<div className="logs-pane">
|
|
{logEntries && logEntries.length > 0 ? (
|
|
logEntries.map((logEntry, idx) => (
|
|
<PreviewLogEntry
|
|
key={idx}
|
|
{...logEntry}
|
|
onLogEntryLocationClick={onLogEntryLocationClick}
|
|
/>
|
|
))
|
|
) : (
|
|
<div>No logs</div>
|
|
)}
|
|
|
|
<PreviewLogEntry content={rawLog} level="raw" message={t('raw_logs')} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
PreviewLogsPane.propTypes = {
|
|
logEntries: PropTypes.array,
|
|
rawLog: PropTypes.string,
|
|
onLogEntryLocationClick: PropTypes.func.isRequired
|
|
}
|
|
|
|
export default PreviewLogsPane
|