ArchiveFilesTableMenu.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. import React from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. // import { toastSuccess, toastError } from '~/client/util/apiNotification';
  4. type ArchiveFilesTableMenuProps = {
  5. fileName: string,
  6. onZipFileStatRemove: (fileName: string) => void,
  7. }
  8. const ArchiveFilesTableMenu = (props: ArchiveFilesTableMenuProps):JSX.Element => {
  9. const { t } = useTranslation();
  10. return (
  11. <div className="btn-group admin-user-menu dropdown">
  12. <button type="button" className="btn btn-sm btn-outline-secondary dropdown-toggle" data-toggle="dropdown">
  13. <i className="icon-settings"></i> <span className="caret"></span>
  14. </button>
  15. <ul className="dropdown-menu" role="menu">
  16. <li className="dropdown-header">{t('admin:export_management.export_menu')}</li>
  17. <button type="button" className="dropdown-item" onClick={() => { window.location.href = `/admin/export/${props.fileName}` }}>
  18. <i className="icon-cloud-download" /> {t('admin:export_management.download')}
  19. </button>
  20. <button type="button" className="dropdown-item" role="button" onClick={() => props.onZipFileStatRemove(props.fileName)}>
  21. <span className="text-danger"><i className="icon-trash" /> {t('admin:export_management.delete')}</span>
  22. </button>
  23. </ul>
  24. </div>
  25. );
  26. };
  27. export default ArchiveFilesTableMenu;