2021-09-30 07:29:25 -04:00
|
|
|
import Icon from '../../../shared/components/icon'
|
|
|
|
import { Button } from 'react-bootstrap'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import { memo } from 'react'
|
2022-03-31 07:22:36 -04:00
|
|
|
import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
|
2021-09-30 07:29:25 -04:00
|
|
|
|
|
|
|
function PdfClearCacheButton() {
|
2021-10-15 05:39:56 -04:00
|
|
|
const { compiling, clearCache, clearingCache } = useCompileContext()
|
2021-09-30 07:29:25 -04:00
|
|
|
|
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Button
|
|
|
|
bsSize="small"
|
|
|
|
bsStyle="danger"
|
|
|
|
className="logs-pane-actions-clear-cache"
|
2022-03-31 07:22:36 -04:00
|
|
|
onClick={() => clearCache()}
|
2021-09-30 07:29:25 -04:00
|
|
|
disabled={clearingCache || compiling}
|
|
|
|
>
|
|
|
|
{clearingCache ? <Icon type="refresh" spin /> : <Icon type="trash-o" />}
|
|
|
|
|
|
|
|
<span>{t('clear_cached_files')}</span>
|
|
|
|
</Button>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(PdfClearCacheButton)
|