diff --git a/studio/components/interfaces/Billing/PlanSelection/Plans/Plans.tsx b/studio/components/interfaces/Billing/PlanSelection/Plans/Plans.tsx index ebf2c8d3942..3d315a8502e 100644 --- a/studio/components/interfaces/Billing/PlanSelection/Plans/Plans.tsx +++ b/studio/components/interfaces/Billing/PlanSelection/Plans/Plans.tsx @@ -36,6 +36,11 @@ const Plans: FC = ({ plans, currentPlan, onSelectPlan }) => { return (
{plans.map((plan) => { + const isCurrentPlan = + plan.id === currentPlan?.prod_id || + (plan.id === STRIPE_PRODUCT_IDS.PRO && currentPlan?.prod_id === STRIPE_PRODUCT_IDS.PRO) || + (plan.id === STRIPE_PRODUCT_IDS.PRO && currentPlan?.prod_id === STRIPE_PRODUCT_IDS.PAYG) + return (
= ({ plans, currentPlan, onSelectPlan }) => { {plan.id === STRIPE_PRODUCT_IDS.PRO && } {/* Label to show current subscription (Pro and PAYG are treated as the same plan on the UI) */} - {plan.id === currentPlan?.prod_id || - (plan.id === STRIPE_PRODUCT_IDS.PRO && - (currentPlan?.prod_id === STRIPE_PRODUCT_IDS.PRO || - currentPlan?.prod_id === STRIPE_PRODUCT_IDS.PAYG) && ( - - ))} + {isCurrentPlan && }