(plan: string | null | undefined)
| 56 | * into `pro` / `max` by their credit allocation (>= 25k credits => Max). |
| 57 | */ |
| 58 | export function resolvePlanTier(plan: string | null | undefined): PlanTier { |
| 59 | if (isEnterprise(plan)) return 'enterprise' |
| 60 | if (isFree(plan)) return 'free' |
| 61 | return getPlanTierCredits(plan) >= MAX_TIER_CREDITS ? 'max' : 'pro' |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Derive the CTA for a single upgrade card given the current plan tier. |
no test coverage detected