2021-09-30 07:29:25 -04:00
|
|
|
import { Dropdown } from 'react-bootstrap'
|
|
|
|
import PdfFileList from './pdf-file-list'
|
|
|
|
import ControlledDropdown from '../../../shared/components/controlled-dropdown'
|
|
|
|
import { memo } from 'react'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
2022-03-31 07:22:36 -04:00
|
|
|
import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
|
2021-09-30 07:29:25 -04:00
|
|
|
|
|
|
|
function PdfDownloadFilesButton() {
|
2021-10-15 05:39:56 -04:00
|
|
|
const { compiling, fileList } = useCompileContext()
|
2021-09-30 07:29:25 -04:00
|
|
|
|
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<ControlledDropdown
|
|
|
|
id="dropdown-files-logs-pane"
|
|
|
|
dropup
|
|
|
|
pullRight
|
|
|
|
disabled={compiling || !fileList}
|
|
|
|
>
|
|
|
|
<Dropdown.Toggle
|
2022-12-16 09:45:20 -05:00
|
|
|
className="dropdown-toggle btn-secondary-info btn-secondary"
|
2021-09-30 07:29:25 -04:00
|
|
|
title={t('other_logs_and_files')}
|
|
|
|
bsSize="small"
|
2022-12-16 09:45:20 -05:00
|
|
|
bsStyle={null}
|
2021-09-30 07:29:25 -04:00
|
|
|
/>
|
|
|
|
<Dropdown.Menu id="dropdown-files-logs-pane-list">
|
|
|
|
<PdfFileList fileList={fileList} />
|
|
|
|
</Dropdown.Menu>
|
|
|
|
</ControlledDropdown>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(PdfDownloadFilesButton)
|