import React from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import { format } from 'date-fns'; import ExportTableMenu from './ExportTableMenu'; import { createSubscribedElement } from '../../UnstatedUtils'; import AppContainer from '../../../services/AppContainer'; // import { toastSuccess, toastError } from '../../../util/apiNotification'; class ZipFileTable extends React.Component { render() { // eslint-disable-next-line no-unused-vars const { t } = this.props; return ( {this.props.zipFileStats.map(({ meta, fileName, fileStats }) => { return ( ); })}
{t('export_management.file')} {t('export_management.growi_version')} {t('export_management.collections')} {t('export_management.exported_at')}
{fileName} {meta.version} {fileStats.map(fileStat => fileStat.collectionName).join(', ')} {meta.exportedAt ? format(new Date(meta.exportedAt), 'yyyy/MM/dd HH:mm:ss') : ''}
); } } ZipFileTable.propTypes = { t: PropTypes.func.isRequired, // i18next appContainer: PropTypes.instanceOf(AppContainer).isRequired, zipFileStats: PropTypes.arrayOf(PropTypes.object).isRequired, onZipFileStatRemove: PropTypes.func.isRequired, }; /** * Wrapper component for using unstated */ const ZipFileTableWrapper = (props) => { return createSubscribedElement(ZipFileTable, props, [AppContainer]); }; export default withTranslation()(ZipFileTableWrapper);