mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
8ca159b4b9
PDF Detach GitOrigin-RevId: f69d8a87d1ba2115ad496a719106dfc7707a6ed5
54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
import { memo } from 'react'
|
|
import { ButtonToolbar } from 'react-bootstrap'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useLayoutContext } from '../../../shared/context/layout-context'
|
|
import PdfCompileButton from './pdf-compile-button'
|
|
import PdfExpandButton from './pdf-expand-button'
|
|
import PdfHybridLogsButton from './pdf-hybrid-logs-button'
|
|
import PdfHybridDownloadButton from './pdf-hybrid-download-button'
|
|
import PdfHybridCodeCheckButton from './pdf-hybrid-code-check-button'
|
|
import PdfOrphanRefreshButton from './pdf-orphan-refresh-button'
|
|
|
|
function PdfPreviewHybridToolbar() {
|
|
const { detachMode } = useLayoutContext()
|
|
|
|
return (
|
|
<ButtonToolbar className="toolbar toolbar-pdf toolbar-pdf-hybrid">
|
|
{detachMode === 'orphan' ? (
|
|
<PdfPreviewHybridToolbarOrphanInner />
|
|
) : (
|
|
<PdfPreviewHybridToolbarInner />
|
|
)}
|
|
</ButtonToolbar>
|
|
)
|
|
}
|
|
|
|
function PdfPreviewHybridToolbarInner() {
|
|
return (
|
|
<>
|
|
<div className="toolbar-pdf-left">
|
|
<PdfCompileButton />
|
|
<PdfHybridLogsButton />
|
|
<PdfHybridDownloadButton />
|
|
</div>
|
|
<div className="toolbar-pdf-right">
|
|
<PdfHybridCodeCheckButton />
|
|
{!window.showPdfDetach && <PdfExpandButton />}
|
|
</div>
|
|
</>
|
|
)
|
|
}
|
|
|
|
function PdfPreviewHybridToolbarOrphanInner() {
|
|
const { t } = useTranslation()
|
|
return (
|
|
<>
|
|
<div className="toolbar-pdf-orphan">
|
|
{t('tab_no_longer_connected')}
|
|
<PdfOrphanRefreshButton />
|
|
</div>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default memo(PdfPreviewHybridToolbar)
|