import { MenuItem } from 'react-bootstrap' import { useTranslation } from 'react-i18next' import { memo } from 'react' import PropTypes from 'prop-types' function PdfFileList({ fileList }) { const { t } = useTranslation() if (!fileList) { return null } return ( <> {t('other_output_files')} {fileList.top.map(file => ( {file.path} ))} {fileList.other.length > 0 && fileList.top.length > 0 && ( )} {fileList.other.map(file => ( {file.path} ))} ) } const FilesArray = PropTypes.arrayOf( PropTypes.shape({ path: PropTypes.string.isRequired, url: PropTypes.string.isRequired, }) ) PdfFileList.propTypes = { fileList: PropTypes.shape({ top: FilesArray, other: FilesArray, }), } export default memo(PdfFileList)