mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
f7ef2532e0
* Only hide the compile logs pane when toggled off * Handle PDF preview on toggle between split and full-width views GitOrigin-RevId: 9ceca8a06a22abfa78f245e1ae5d24af98215906
27 lines
775 B
JavaScript
27 lines
775 B
JavaScript
import Icon from '../../../shared/components/icon'
|
|
import { Button } from 'react-bootstrap'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { memo } from 'react'
|
|
import { useCompileContext } from '../../../shared/context/compile-context'
|
|
|
|
function PdfClearCacheButton() {
|
|
const { compiling, clearCache, clearingCache } = useCompileContext()
|
|
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<Button
|
|
bsSize="small"
|
|
bsStyle="danger"
|
|
className="logs-pane-actions-clear-cache"
|
|
onClick={clearCache}
|
|
disabled={clearingCache || compiling}
|
|
>
|
|
{clearingCache ? <Icon type="refresh" spin /> : <Icon type="trash-o" />}
|
|
|
|
<span>{t('clear_cached_files')}</span>
|
|
</Button>
|
|
)
|
|
}
|
|
|
|
export default memo(PdfClearCacheButton)
|