mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
bce320f4bc
Place the download PDF tooltip to the bottom GitOrigin-RevId: e2171c4417de66f2143be66dc76ca7c450c43234
35 lines
978 B
TypeScript
35 lines
978 B
TypeScript
import { useTranslation } from 'react-i18next'
|
|
import { Button } from 'react-bootstrap'
|
|
import Tooltip from '../../../shared/components/tooltip'
|
|
import Icon from '../../../shared/components/icon'
|
|
import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
|
|
|
|
function PdfHybridDownloadButton() {
|
|
const { pdfDownloadUrl } = useCompileContext()
|
|
|
|
const { t } = useTranslation()
|
|
const description = pdfDownloadUrl
|
|
? t('download_pdf')
|
|
: t('please_compile_pdf_before_download')
|
|
|
|
return (
|
|
<Tooltip
|
|
id="logs-toggle"
|
|
description={description}
|
|
overlayProps={{ placement: 'bottom' }}
|
|
>
|
|
<Button
|
|
bsStyle="link"
|
|
disabled={!pdfDownloadUrl}
|
|
download
|
|
href={pdfDownloadUrl || '#'}
|
|
target="_blank"
|
|
style={{ pointerEvents: 'auto' }}
|
|
>
|
|
<Icon type="download" fw />
|
|
</Button>
|
|
</Tooltip>
|
|
)
|
|
}
|
|
|
|
export default PdfHybridDownloadButton
|