MCPcopy Index your code
hub / github.com/simstudioai/sim / getDisplayPlanName

Function getDisplayPlanName

apps/sim/lib/billing/plan-helpers.ts:145–155  ·  view source on GitHub ↗
(plan: string | null | undefined)

Source from the content-addressed store, hash-verified

143}
144
145export function getDisplayPlanName(plan: string | null | undefined): string {
146 if (!plan || isFree(plan)) return 'Free'
147 if (isEnterprise(plan)) return 'Enterprise'
148 const credits = getPlanTierCredits(plan)
149 const tier = CREDIT_TIERS.find((t) => t.credits === credits)
150 const isLegacy = plan === 'pro' || plan === 'team'
151 const tierName = tier?.name ?? (plan === 'team' ? 'Max' : 'Pro')
152 const prefix = isLegacy ? 'Legacy ' : ''
153 const suffix = isTeam(plan) ? ' for Teams' : ''
154 return `${prefix}${tierName}${suffix}`
155}

Callers 4

useSubscriptionUpgradeFunction · 0.90
BillingFunction · 0.90
sendPlanWelcomeEmailFunction · 0.85

Calls 4

isFreeFunction · 0.85
getPlanTierCreditsFunction · 0.85
isTeamFunction · 0.85
isEnterpriseFunction · 0.70

Tested by

no test coverage detected