2021-09-30 07:29:25 -04:00
|
|
|
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'
|
2021-10-15 06:42:47 -04:00
|
|
|
import PdfLogEntry from './pdf-log-entry'
|
2021-11-10 05:50:01 -05:00
|
|
|
import UpgradeBenefits from '../../../shared/components/upgrade-benefits'
|
2021-09-30 07:29:25 -04:00
|
|
|
|
|
|
|
function TimeoutUpgradePrompt() {
|
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
const { hasPremiumCompile, isProjectOwner } = useEditorContext()
|
|
|
|
|
|
|
|
if (!window.ExposedSettings.enableSubscriptions || hasPremiumCompile) {
|
2021-10-15 05:46:12 -04:00
|
|
|
return null
|
2021-09-30 07:29:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2021-10-15 06:42:47 -04:00
|
|
|
<PdfLogEntry
|
2021-09-30 07:29:25 -04:00
|
|
|
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>
|
2021-11-10 05:50:01 -05:00
|
|
|
<UpgradeBenefits />
|
2021-09-30 07:29:25 -04:00
|
|
|
</div>
|
|
|
|
{isProjectOwner && (
|
|
|
|
<p className="text-center">
|
|
|
|
<StartFreeTrialButton
|
|
|
|
source="compile-timeout"
|
2022-07-25 08:33:25 -04:00
|
|
|
buttonProps={{
|
|
|
|
bsStyle: 'success',
|
|
|
|
className: 'row-spaced-small',
|
|
|
|
}}
|
2021-09-30 07:29:25 -04:00
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
entryAriaLabel={
|
|
|
|
isProjectOwner
|
|
|
|
? t('upgrade_for_longer_compiles')
|
|
|
|
: t('ask_proj_owner_to_upgrade_for_longer_compiles')
|
|
|
|
}
|
|
|
|
level="success"
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(TimeoutUpgradePrompt)
|