Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

fix: show prompt if usage limit is exceeded

Carl-Gerhard Lindesvärd447b7668fd37
diff --git a/apps/start/src/routes/_app.$organizationId.tsx b/apps/start/src/routes/_app.$organizationId.tsx
index 9b7c8c6c9..a907dc0f4 100644
--- a/apps/start/src/routes/_app.$organizationId.tsx
+++ b/apps/start/src/routes/_app.$organizationId.tsx
@@ -136,6 +136,22 @@ function Component() {
</LinkButton>
</Alert>
)}
+ {organization.subscriptionPeriodEventsCountExceededAt &&
+ organization.isActive && (
+ <Alert
+ title="Events limit exceeded"
+ description={`Your subscription has exceeded the limit on ${format(organization.subscriptionPeriodEventsCountExceededAt, 'PPP')}`}
+ >
+ <LinkButton
+ to="/$organizationId/billing"
+ params={{
+ organizationId: organizationId,
+ }}
+ >
+ Upgrade now
+ </LinkButton>
+ </Alert>
+ )}
<Outlet />
<SupporterPrompt />
</>