Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add badge to sections which are not included in plan

Joshen Lima20b803fc290
diff --git a/studio/components/interfaces/BillingV2/Usage/Activity.tsx b/studio/components/interfaces/BillingV2/Usage/Activity.tsx
index 150cad37dcf..bcdf36faca2 100644
--- a/studio/components/interfaces/BillingV2/Usage/Activity.tsx
+++ b/studio/components/interfaces/BillingV2/Usage/Activity.tsx
@@ -130,6 +130,7 @@ const Activity = ({ projectRef }: ActivityProps) => {
key={attribute.key}
title={attribute.name}
description={attribute.description}
+ includedInPlan={usageMeta.available_in_plan}
>
<div className="space-y-2">
<div className="flex items-center justify-between">
diff --git a/studio/components/interfaces/BillingV2/Usage/SectionContent.tsx b/studio/components/interfaces/BillingV2/Usage/SectionContent.tsx
index 7168b0b63cc..1f8407d2025 100644
--- a/studio/components/interfaces/BillingV2/Usage/SectionContent.tsx
+++ b/studio/components/interfaces/BillingV2/Usage/SectionContent.tsx
@@ -1,23 +1,39 @@
import { PropsWithChildren } from 'react'
+import { Badge } from 'ui'
export interface SectionContent {
title: string
description: string
+ includedInPlan?: boolean
}
-const SectionContent = ({ title, description, children }: PropsWithChildren<SectionContent>) => {
+const SectionContent = ({
+ title,
+ description,
+ includedInPlan,
+ children,
+}: PropsWithChildren<SectionContent>) => {
return (
<div className="border-b">
<div className="1xl:px-28 mx-auto flex flex-col gap-10 px-5 lg:px-16 2xl:px-32 py-16">
<div className="grid grid-cols-12 gap-x-6">
<div className="col-span-5">
<div className="sticky top-16 space-y-1">
- <p className="text-base capitalize">{title}</p>
+ <div className="flex items-center space-x-2">
+ <p className="text-base capitalize">{title}</p>
+ {includedInPlan === false && <Badge color="gray">Not included</Badge>}
+ </div>
{description.split('\n').map((value, idx) => (
<p key={`desc-${idx}`} className="text-sm text-scale-1000">
{value}
</p>
))}
+ {/* [Joshen] Feels a little too wordy if include below CTA */}
+ {/* {includedInPlan === false && (
+ <p className="text-sm text-scale-1000">
+ Upgrade your project to have access to <span className="lowercase">{title}</span>
+ </p>
+ )} */}
</div>
</div>
<div className="col-span-7 space-y-6">{children}</div>
diff --git a/studio/components/interfaces/BillingV2/Usage/Usage.constants.ts b/studio/components/interfaces/BillingV2/Usage/Usage.constants.ts
index b24866490ea..b987c8837be 100644
--- a/studio/components/interfaces/BillingV2/Usage/Usage.constants.ts
+++ b/studio/components/interfaces/BillingV2/Usage/Usage.constants.ts
@@ -116,7 +116,7 @@ export const USAGE_CATEGORIES: {
{
key: 'monthly_active_users',
attribute: 'total_auth_billing_period_mau',
- name: 'Monthly active users (MAU)',
+ name: 'Monthly active users',
unit: 'absolute',
description:
'The amount of distinct users requesting your API throughout the billing period. Resets at the beginning of every billing period.',
@@ -125,7 +125,7 @@ export const USAGE_CATEGORIES: {
{
key: 'monthly_active_sso_users',
attribute: 'total_auth_billing_period_sso_mau',
- name: 'Monthly active single sign-on (SSO) users',
+ name: 'Monthly active single sign-on users',
unit: 'absolute',
description:
'The amount of distinct Single Sign-On users requesting your API throughout the billing period. Resets at the beginning of every billing period.',