2024-10-23 03:32:40 -04:00
|
|
|
import { Dropdown as BS3Dropdown } from 'react-bootstrap'
|
|
|
|
|
|
|
|
import {
|
|
|
|
Dropdown,
|
|
|
|
DropdownMenu,
|
|
|
|
DropdownToggle,
|
|
|
|
} from '@/features/ui/components/bootstrap-5/dropdown-menu'
|
2021-09-30 07:29:25 -04:00
|
|
|
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'
|
2024-10-23 03:32:40 -04:00
|
|
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
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 (
|
2024-10-23 03:32:40 -04:00
|
|
|
<BootstrapVersionSwitcher
|
|
|
|
bs3={
|
|
|
|
<ControlledDropdown
|
|
|
|
id="dropdown-files-logs-pane"
|
|
|
|
dropup
|
|
|
|
pullRight
|
|
|
|
disabled={compiling || !fileList}
|
|
|
|
>
|
|
|
|
<BS3Dropdown.Toggle
|
|
|
|
className="dropdown-toggle btn-secondary-info btn-secondary"
|
|
|
|
title={t('other_logs_and_files')}
|
|
|
|
bsSize="small"
|
|
|
|
bsStyle={null}
|
|
|
|
/>
|
|
|
|
<BS3Dropdown.Menu id="dropdown-files-logs-pane-list">
|
|
|
|
<PdfFileList fileList={fileList} />
|
|
|
|
</BS3Dropdown.Menu>
|
|
|
|
</ControlledDropdown>
|
|
|
|
}
|
|
|
|
bs5={
|
|
|
|
<Dropdown drop="up">
|
|
|
|
<DropdownToggle
|
|
|
|
id="dropdown-files-logs-pane"
|
|
|
|
variant="secondary"
|
|
|
|
title={t('other_logs_and_files')}
|
|
|
|
size="sm"
|
|
|
|
disabled={compiling || !fileList}
|
|
|
|
>
|
|
|
|
{t('other_logs_and_files')}
|
|
|
|
</DropdownToggle>
|
|
|
|
<DropdownMenu id="dropdown-files-logs-pane-list">
|
|
|
|
<PdfFileList fileList={fileList} />
|
|
|
|
</DropdownMenu>
|
|
|
|
</Dropdown>
|
|
|
|
}
|
|
|
|
/>
|
2021-09-30 07:29:25 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(PdfDownloadFilesButton)
|