pdf-log-entry-content.js 932 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { useTranslation } from 'react-i18next'
  2. import PdfLogEntryRawContent from './pdf-log-entry-raw-content'
  3. import PropTypes from 'prop-types'
  4. export default function PdfLogEntryContent({
  5. rawContent,
  6. formattedContent,
  7. extraInfoURL,
  8. }) {
  9. const { t } = useTranslation()
  10. return (
  11. <div className="log-entry-content">
  12. {formattedContent && (
  13. <div className="log-entry-formatted-content">{formattedContent}</div>
  14. )}
  15. {extraInfoURL && (
  16. <div className="log-entry-content-link">
  17. <a href={extraInfoURL} target="_blank" rel="noopener">
  18. {t('log_hint_extra_info')}
  19. </a>
  20. </div>
  21. )}
  22. {rawContent && (
  23. <PdfLogEntryRawContent rawContent={rawContent} collapsedSize={150} />
  24. )}
  25. </div>
  26. )
  27. }
  28. PdfLogEntryContent.propTypes = {
  29. rawContent: PropTypes.string,
  30. formattedContent: PropTypes.node,
  31. extraInfoURL: PropTypes.string,
  32. }