| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import React from 'react';
- import { format } from 'date-fns/format';
- import { useTranslation } from 'next-i18next';
- import ArchiveFilesTableMenu from './ArchiveFilesTableMenu';
- type ArchiveFilesTableProps = {
- zipFileStats: any[],
- onZipFileStatRemove: (fileName: string) => void,
- }
- const ArchiveFilesTable = (props: ArchiveFilesTableProps): JSX.Element => {
- const { t } = useTranslation();
- return (
- <div className="table-responsive">
- <table className="table table-bordered">
- <thead>
- <tr>
- <th>{t('admin:export_management.file')}</th>
- <th>{t('admin:export_management.growi_version')}</th>
- <th>{t('admin:export_management.collections')}</th>
- <th>{t('admin:export_management.exported_at')}</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- {props.zipFileStats.map(({ meta, fileName, innerFileStats }) => {
- return (
- <tr key={fileName}>
- <th>{fileName}</th>
- <td>{meta.version}</td>
- <td className="text-capitalize">{innerFileStats.map(fileStat => fileStat.collectionName).join(', ')}</td>
- <td>{meta.exportedAt ? format(new Date(meta.exportedAt), 'yyyy/MM/dd HH:mm:ss') : ''}</td>
- <td>
- <ArchiveFilesTableMenu
- fileName={fileName}
- onZipFileStatRemove={props.onZipFileStatRemove}
- />
- </td>
- </tr>
- );
- })}
- </tbody>
- </table>
- </div>
- );
- };
- export default ArchiveFilesTable;
|