(plan: string | null | undefined)
| 106 | |
| 107 | /** Derive the shared plan view from a plan name. */ |
| 108 | export function derivePlanView(plan: string | null | undefined): PlanView { |
| 109 | const enterprise = isEnterprise(plan) |
| 110 | return { |
| 111 | tier: resolvePlanTier(plan), |
| 112 | isFree: isFree(plan), |
| 113 | isPaid: isPaid(plan), |
| 114 | isEnterprise: enterprise, |
| 115 | canAccessUpgrade: !enterprise, |
| 116 | showCredits: !enterprise, |
| 117 | } |
| 118 | } |
no test coverage detected