import { Button, OverlayTrigger, Tooltip } from 'react-bootstrap' import PropTypes from 'prop-types' import Icon from '../../../shared/components/icon' import { useTranslation } from 'react-i18next' import { memo } from 'react' import { useLayoutContext } from '../../../shared/context/layout-context' const modifierKey = /Mac/i.test(navigator.platform) ? 'Cmd' : 'Ctrl' function PdfCompileButtonInner({ startCompile, compiling }) { const { detachRole } = useLayoutContext() const { t } = useTranslation() const compileButtonLabel = compiling ? t('compiling') + '…' : t('recompile') return ( {t('recompile_pdf')}{' '} {detachRole !== 'detached' && ( ({modifierKey} + Enter) )} } > ) } PdfCompileButtonInner.propTypes = { compiling: PropTypes.bool.isRequired, startCompile: PropTypes.func.isRequired, } export default memo(PdfCompileButtonInner)