overleaf/services/web/frontend/js/features/pdf-preview/components/pdf-download-files-button.jsx
Jakob Ackermann 9daa8f5d98 Merge pull request #15040 from overleaf/jpa-js-to-jsx
[web] rename all the JSX files to .jsx/.tsx

GitOrigin-RevId: 82056ae47e017523722cf258dcc83c8a925a28f7
2023-09-29 08:04:29 +00:00

33 lines
1,013 B
JavaScript

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'
import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
function PdfDownloadFilesButton() {
const { compiling, fileList } = useCompileContext()
const { t } = useTranslation()
return (
<ControlledDropdown
id="dropdown-files-logs-pane"
dropup
pullRight
disabled={compiling || !fileList}
>
<Dropdown.Toggle
className="dropdown-toggle btn-secondary-info btn-secondary"
title={t('other_logs_and_files')}
bsSize="small"
bsStyle={null}
/>
<Dropdown.Menu id="dropdown-files-logs-pane-list">
<PdfFileList fileList={fileList} />
</Dropdown.Menu>
</ControlledDropdown>
)
}
export default memo(PdfDownloadFilesButton)