From 826dbdbe63a0f3aa19e01402be7b87da0b11ef90 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Fri, 20 Feb 2026 02:46:23 +0100 Subject: [PATCH] feat: implement site limits based on subscription plans across dashboard and new site creation; enhance UI feedback for plan limits --- app/page.tsx | 16 ++++++++++++---- app/sites/new/page.tsx | 6 ++++-- components/settings/OrganizationSettings.tsx | 9 +++++---- lib/plans.ts | 15 ++++++++++++++- 4 files changed, 35 insertions(+), 11 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 90eed1d..de34a12 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -13,6 +13,7 @@ import { Button } from '@ciphera-net/ui' import { BarChartIcon, LockIcon, ZapIcon, CheckCircleIcon, XIcon, GlobeIcon } from '@ciphera-net/ui' import { toast } from '@ciphera-net/ui' import { getAuthErrorMessage } from '@ciphera-net/ui' +import { getSitesLimitForPlan } from '@/lib/plans' function DashboardPreview() { return ( @@ -337,10 +338,13 @@ export default function HomePage() {

Your Sites

Manage your analytics sites and view insights.

- {subscription?.plan_id === 'solo' && sites.length >= 1 ? ( + {(() => { + const siteLimit = getSitesLimitForPlan(subscription?.plan_id) + const atLimit = siteLimit != null && sites.length >= siteLimit + return atLimit ? (
- Limit reached (1/1) + Limit reached ({sites.length}/{siteLimit})
- ) : ( + ) : null + })() ?? (