overleaf-cep/services/web/frontend/js/features/pdf-preview/components/pdf-clear-cache-button.tsx
Alf Eaton 2147f1d53d Remove Bootstrap 3 code from IDE page components (#23061)
GitOrigin-RevId: b41aff10672bf96e892de0be396a69eb25e2443b
2025-03-07 09:05:45 +00:00

27 lines
797 B
TypeScript

import OLButton from '@/features/ui/components/ol/ol-button'
import { useTranslation } from 'react-i18next'
import { memo } from 'react'
import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
function PdfClearCacheButton() {
const { compiling, clearCache, clearingCache } = useCompileContext()
const { t } = useTranslation()
return (
<OLButton
size="sm"
variant="danger"
className="logs-pane-actions-clear-cache"
onClick={() => clearCache()}
isLoading={clearingCache}
disabled={clearingCache || compiling}
leadingIcon="delete"
loadingLabel={t('clear_cached_files')}
>
<span>{t('clear_cached_files')}</span>
</OLButton>
)
}
export default memo(PdfClearCacheButton)