mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
9daa8f5d98
[web] rename all the JSX files to .jsx/.tsx GitOrigin-RevId: 82056ae47e017523722cf258dcc83c8a925a28f7
36 lines
955 B
JavaScript
36 lines
955 B
JavaScript
import { memo, useCallback } from 'react'
|
|
import { Button } from 'react-bootstrap'
|
|
import Icon from '../../../shared/components/icon'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
|
|
|
|
function PdfHybridCodeCheckButton() {
|
|
const { codeCheckFailed, error, toggleLogs } = useCompileContext()
|
|
|
|
const { t } = useTranslation()
|
|
|
|
const handleClick = useCallback(() => {
|
|
toggleLogs()
|
|
}, [toggleLogs])
|
|
|
|
if (!codeCheckFailed) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<Button
|
|
bsSize="xsmall"
|
|
bsStyle="danger"
|
|
disabled={Boolean(error)}
|
|
className="btn-toggle-logs toolbar-item"
|
|
onClick={handleClick}
|
|
>
|
|
<Icon type="exclamation-triangle" />
|
|
<span className="toolbar-text toolbar-hide-small">
|
|
{t('code_check_failed')}
|
|
</span>
|
|
</Button>
|
|
)
|
|
}
|
|
|
|
export default memo(PdfHybridCodeCheckButton)
|