|
21 | 21 | import { ContainerButton } from '.'; |
22 | 22 | import { goto } from '$app/navigation'; |
23 | 23 | import { Layout, Typography } from '@appwrite.io/pink-svelte'; |
| 24 | + import { isFreePlan } from '$lib/helpers/billing'; |
24 | 25 |
|
25 | 26 | export let title: string; |
26 | 27 | export let serviceId = title.toLocaleLowerCase() as PlanServices; |
|
68 | 69 | // these can be organization level limitations as well. |
69 | 70 | // we need to migrate this sometime later, but soon! |
70 | 71 | $: hasProjectLimitation = |
71 | | - checkForProjectLimitation(serviceId) && $organization?.billingPlan === BillingPlan.FREE; |
| 72 | + checkForProjectLimitation(serviceId) && isFreePlan($organization?.billingPlan); |
72 | 73 | $: hasUsageFees = hasProjectLimitation |
73 | 74 | ? checkForUsageFees($organization?.billingPlan, serviceId) |
74 | 75 | : false; |
|
99 | 100 |
|
100 | 101 | {#if services.length} |
101 | 102 | <slot name="alert" {limit} {tier} {title} {upgradeMethod} {hasUsageFees} {services}> |
102 | | - {#if $organization?.billingPlan !== BillingPlan.FREE && hasUsageFees} |
| 103 | + {#if !isFreePlan($organization?.billingPlan) && hasUsageFees} |
103 | 104 | <Alert.Inline status="info"> |
104 | 105 | <span class="text"> |
105 | 106 | You've reached the {services} limit for the {tier} plan. |
|
149 | 150 | <p class="text"> |
150 | 151 | You are limited to {limit} |
151 | 152 | {title.toLocaleLowerCase()} per project on the {tier} plan. |
152 | | - {#if $organization?.billingPlan === BillingPlan.FREE}<Link |
| 153 | + {#if isFreePlan($organization?.billingPlan)}<Link |
153 | 154 | href={$upgradeURL} |
154 | 155 | event="organization_upgrade" |
155 | 156 | eventData={{ from: 'button', source: 'resource_limit_tag' }} |
|
169 | 170 | <p class="text"> |
170 | 171 | You are limited to {limit} |
171 | 172 | {title.toLocaleLowerCase()} per organization on the {tier} plan. |
172 | | - {#if $organization?.billingPlan === BillingPlan.FREE} |
| 173 | + {#if isFreePlan($organization?.billingPlan)} |
173 | 174 | <Link href={$upgradeURL}>Upgrade</Link> |
174 | 175 | for additional {title.toLocaleLowerCase()}. |
175 | 176 | {/if} |
|
0 commit comments