import { useTranslation } from 'react-i18next' import PdfLogEntryRawContent from './pdf-log-entry-raw-content' import importOverleafModules from '../../../../macros/import-overleaf-module.macro' import { LogEntry } from '../util/types' import { ElementType } from 'react' const pdfLogEntryComponents = importOverleafModules( 'pdfLogEntryComponents' ) as { import: { default: ElementType } path: string }[] export default function PdfLogEntryContent({ rawContent, formattedContent, extraInfoURL, index, logEntry, }: { rawContent?: string formattedContent?: React.ReactNode extraInfoURL?: string | null index?: number logEntry?: LogEntry }) { const { t } = useTranslation() return (
{formattedContent && (
{formattedContent}
)} {extraInfoURL && (
{t('log_hint_extra_info')}
)} {logEntry && pdfLogEntryComponents.map( ({ import: { default: Component }, path }) => ( ) )} {rawContent && ( )}
) }