mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 11:54:12 -05:00
4f340b0ed7
[web] Cleanup StartFreeTrialButton component GitOrigin-RevId: 67538882ff5a3389d2134ec6e4833431aa43f8e6
54 lines
1.6 KiB
JavaScript
54 lines
1.6 KiB
JavaScript
import { useTranslation } from 'react-i18next'
|
|
import { useEditorContext } from '../../../shared/context/editor-context'
|
|
import StartFreeTrialButton from '../../../shared/components/start-free-trial-button'
|
|
import { memo } from 'react'
|
|
import PdfLogEntry from './pdf-log-entry'
|
|
import UpgradeBenefits from '../../../shared/components/upgrade-benefits'
|
|
|
|
function TimeoutUpgradePrompt() {
|
|
const { t } = useTranslation()
|
|
|
|
const { hasPremiumCompile, isProjectOwner } = useEditorContext()
|
|
|
|
if (!window.ExposedSettings.enableSubscriptions || hasPremiumCompile) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<PdfLogEntry
|
|
headerTitle={
|
|
isProjectOwner
|
|
? t('upgrade_for_longer_compiles')
|
|
: t('ask_proj_owner_to_upgrade_for_longer_compiles')
|
|
}
|
|
formattedContent={
|
|
<>
|
|
<p>{t('free_accounts_have_timeout_upgrade_to_increase')}</p>
|
|
<p>{t('plus_upgraded_accounts_receive')}:</p>
|
|
<div>
|
|
<UpgradeBenefits />
|
|
</div>
|
|
{isProjectOwner && (
|
|
<p className="text-center">
|
|
<StartFreeTrialButton
|
|
source="compile-timeout"
|
|
buttonProps={{
|
|
bsStyle: 'success',
|
|
className: 'row-spaced-small',
|
|
}}
|
|
/>
|
|
</p>
|
|
)}
|
|
</>
|
|
}
|
|
entryAriaLabel={
|
|
isProjectOwner
|
|
? t('upgrade_for_longer_compiles')
|
|
: t('ask_proj_owner_to_upgrade_for_longer_compiles')
|
|
}
|
|
level="success"
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default memo(TimeoutUpgradePrompt)
|