feat: implement site limits based on subscription plans across dashboard and new site creation; enhance UI feedback for plan limits

This commit is contained in:
Usman Baig
2026-02-20 02:46:23 +01:00
parent f9eb6bf5c0
commit 826dbdbe63
4 changed files with 35 additions and 11 deletions

View File

@@ -1,9 +1,22 @@
/**
* Shared plan and traffic tier definitions for pricing and billing (Change plan).
* Backend supports plan_id "solo" and limit 10k10M; month/year interval.
* Backend supports plan_id solo, team, business and limit 10k10M; month/year interval.
*/
export const PLAN_ID_SOLO = 'solo'
export const PLAN_ID_TEAM = 'team'
export const PLAN_ID_BUSINESS = 'business'
/** Sites limit per plan. Returns null for free (no limit enforced in UI). */
export function getSitesLimitForPlan(planId: string | null | undefined): number | null {
if (!planId || planId === 'free') return null
switch (planId) {
case 'solo': return 1
case 'team': return 5
case 'business': return 10
default: return null
}
}
/** Traffic tiers available for Solo plan (pageview limits). */
export const TRAFFIC_TIERS = [