pdf-download-files-button.js 1013 B

123456789101112131415161718192021222324252627282930313233
  1. import { Dropdown } from 'react-bootstrap'
  2. import PdfFileList from './pdf-file-list'
  3. import ControlledDropdown from '../../../shared/components/controlled-dropdown'
  4. import { memo } from 'react'
  5. import { useTranslation } from 'react-i18next'
  6. import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
  7. function PdfDownloadFilesButton() {
  8. const { compiling, fileList } = useCompileContext()
  9. const { t } = useTranslation()
  10. return (
  11. <ControlledDropdown
  12. id="dropdown-files-logs-pane"
  13. dropup
  14. pullRight
  15. disabled={compiling || !fileList}
  16. >
  17. <Dropdown.Toggle
  18. className="dropdown-toggle btn-secondary-info btn-secondary"
  19. title={t('other_logs_and_files')}
  20. bsSize="small"
  21. bsStyle={null}
  22. />
  23. <Dropdown.Menu id="dropdown-files-logs-pane-list">
  24. <PdfFileList fileList={fileList} />
  25. </Dropdown.Menu>
  26. </ControlledDropdown>
  27. )
  28. }
  29. export default memo(PdfDownloadFilesButton)