diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index bf0b0f3768..53fc6adae9 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -626,7 +626,9 @@ "get_error_assist": "", "get_exclusive_access_to_labs": "", "get_in_touch": "", - "get_most_subscription_discover_premium_features": "", + "get_most_subscription_by_checking_ai_writefull": "", + "get_most_subscription_by_checking_overleaf": "", + "get_most_subscription_by_checking_overleaf_ai_writefull": "", "get_real_time_track_changes": "", "git": "", "git_authentication_token": "", diff --git a/services/web/frontend/js/features/subscription/components/dashboard/premium-features-link.tsx b/services/web/frontend/js/features/subscription/components/dashboard/premium-features-link.tsx index 068857f6c8..14d9c8682a 100644 --- a/services/web/frontend/js/features/subscription/components/dashboard/premium-features-link.tsx +++ b/services/web/frontend/js/features/subscription/components/dashboard/premium-features-link.tsx @@ -1,10 +1,63 @@ import { Trans } from 'react-i18next' +import { Subscription } from '../../../../../../types/subscription/dashboard/subscription' +import { AI_ADD_ON_CODE, isStandaloneAiPlanCode } from '../../data/add-on-codes' + +function PremiumFeaturesLink({ + subscription, +}: { + subscription?: Subscription +}) { + const hasAiAddon = subscription?.addOns?.some( + addOn => addOn.addOnCode === AI_ADD_ON_CODE + ) + const onAiStandalonePlan = isStandaloneAiPlanCode(subscription?.planCode) + + if (onAiStandalonePlan) { + return ( +
+
+
{t('need_anything_contact_us_at')}
diff --git a/services/web/frontend/js/features/subscription/data/add-on-codes.ts b/services/web/frontend/js/features/subscription/data/add-on-codes.ts
index 80942ff215..4ee7a65b22 100644
--- a/services/web/frontend/js/features/subscription/data/add-on-codes.ts
+++ b/services/web/frontend/js/features/subscription/data/add-on-codes.ts
@@ -4,10 +4,10 @@ import { PendingPaymentProviderPlan } from "../../../../../types/subscription/pl
export const AI_ASSIST_STANDALONE_MONTHLY_PLAN_CODE = 'assistant'
export const AI_ADD_ON_CODE = 'assistant'
// we dont want translations on plan or add-on names
-export const ADD_ON_NAME = "Error Assist"
+export const ADD_ON_NAME = "AI Assist"
export const AI_ASSIST_STANDALONE_ANNUAL_PLAN_CODE = 'assistant-annual'
-export function isStandaloneAiPlanCode(planCode: string) {
+export function isStandaloneAiPlanCode(planCode?: string) {
return planCode === AI_ASSIST_STANDALONE_MONTHLY_PLAN_CODE || planCode === AI_ASSIST_STANDALONE_ANNUAL_PLAN_CODE
}
diff --git a/services/web/locales/en.json b/services/web/locales/en.json
index 30ac3c472e..97818e2116 100644
--- a/services/web/locales/en.json
+++ b/services/web/locales/en.json
@@ -827,7 +827,9 @@
"get_in_touch": "Get in touch",
"get_in_touch_having_problems": "Get in touch with support if you’re having problems",
"get_involved": "Get involved",
- "get_most_subscription_discover_premium_features": "Get the most from your __appName__ subscription. <0>Discover premium features0>.",
+ "get_most_subscription_by_checking_ai_writefull": "Get the most out of your subscription by checking out <0>Overleaf’s AI features0> and <1>Writefull’s features1>.",
+ "get_most_subscription_by_checking_overleaf": "Get the most out of your subscription by checking out <0>Overleaf’s features0>.",
+ "get_most_subscription_by_checking_overleaf_ai_writefull": "Get the most out of your subscription by checking out <0>Overleaf’s features0>, <1>Overleaf’s AI features1> and <2>Writefull’s features2>.",
"get_real_time_track_changes": "Get real-time track changes",
"get_the_best_overleaf_experience": "Get the best Overleaf experience",
"get_the_most_out_headline": "Get the most out of __appName__ with features such as:",
diff --git a/services/web/test/frontend/features/subscription/components/dashboard/subscription-dashboard.test.tsx b/services/web/test/frontend/features/subscription/components/dashboard/subscription-dashboard.test.tsx
index 77d377cd60..364b09820e 100644
--- a/services/web/test/frontend/features/subscription/components/dashboard/subscription-dashboard.test.tsx
+++ b/services/web/test/frontend/features/subscription/components/dashboard/subscription-dashboard.test.tsx
@@ -32,7 +32,7 @@ describe('