import { memo, useCallback, useEffect } from 'react' import { Button } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import * as eventTracking from '../../../infrastructure/event-tracking' import { useDetachCompileContext } from '../../../shared/context/detach-compile-context' import { startFreeTrial } from '../../../main/account-upgrade' function CompileTimeWarning() { const { t } = useTranslation() const { showCompileTimeWarning, setShowCompileTimeWarning } = useDetachCompileContext() useEffect(() => { if (showCompileTimeWarning) { eventTracking.sendMB('compile-time-warning-displayed', {}) } }, [showCompileTimeWarning]) const closeWarning = () => { eventTracking.sendMB('compile-time-warning-dismissed', {}) setShowCompileTimeWarning(false) } const handleUpgradeClick = useCallback(event => { event.preventDefault() startFreeTrial('compile-time-warning') }, []) if (!showCompileTimeWarning) { return null } return (
]} />
) } export default memo(CompileTimeWarning)