Skip to content

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

feat(studio): usage area brush up (#38408)

kemal.eartha5787082315a
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx
index 6557966d680..ed79e6d5687 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx
@@ -4,11 +4,11 @@ import { PricingMetric } from 'data/analytics/org-daily-stats-query'
import type { OrgSubscription } from 'data/subscriptions/types'
import type { OrgUsageResponse } from 'data/usage/org-usage-query'
import { formatCurrency } from 'lib/helpers'
+import { ChevronRight } from 'lucide-react'
import { useMemo } from 'react'
-import { Button, HoverCard, HoverCardContent, HoverCardTrigger } from 'ui'
+import { Button, cn, HoverCard, HoverCardContent, HoverCardTrigger } from 'ui'
import { billingMetricUnit, formatUsage } from '../helpers'
import { Metric, USAGE_APPROACHING_THRESHOLD } from './BillingBreakdown.constants'
-import { ChevronRight } from 'lucide-react'
export interface BillingMetricProps {
idx: number
@@ -17,14 +17,16 @@ export interface BillingMetricProps {
usage: OrgUsageResponse
subscription: OrgSubscription
relativeToSubscription: boolean
+ className?: string
}
-const BillingMetric = ({
+export const BillingMetric = ({
slug,
metric,
usage,
subscription,
relativeToSubscription,
+ className,
}: BillingMetricProps) => {
const usageMeta = usage.usages.find((x) => x.metric === metric.key)
@@ -79,31 +81,41 @@ const BillingMetric = ({
return (
<HoverCard openDelay={50} closeDelay={200}>
<HoverCardTrigger asChild>
- <div className="flex items-center justify-between">
- <Link href={`/org/${slug}/usage#${metric.anchor}`} className="block w-full group">
- {metric.anchor ? (
+ <div className={cn('flex items-center justify-between', className)}>
+ {metric.anchor ? (
+ <Link href={`/org/${slug}/usage#${metric.anchor}`} className="block w-full group">
<div className="group flex items-center gap-1">
<p className="text-sm text-foreground-light group-hover:text-foreground transition cursor-pointer">
{metric.name}
</p>
{usageMeta.available_in_plan && (
- <span className="transition inline-block group-hover:transform group-hover:translate-x-0.5">
+ <span className="text-foreground-muted transition inline-block group-hover:transform group-hover:translate-x-0.5">
<ChevronRight strokeWidth={1.5} size={16} className="transition" />
</span>
)}
</div>
- ) : (
- <p className="text-xs text-foreground-light flex space-x-1">{metric.name}</p>
- )}
- <span className="text-sm">{usageLabel}</span>&nbsp;
- {relativeToSubscription && usageMeta.cost && usageMeta.cost > 0 ? (
- <span className="text-sm" translate="no">
- ({formatCurrency(usageMeta.cost)})
- </span>
- ) : usageMeta.available_in_plan && !usageMeta.unlimited && relativeToSubscription ? (
- <span className="text-sm">{percentageLabel}</span>
- ) : null}
- </Link>
+ <span className="text-sm">{usageLabel}</span>&nbsp;
+ {relativeToSubscription && usageMeta.cost && usageMeta.cost > 0 ? (
+ <span className="text-sm" translate="no">
+ ({formatCurrency(usageMeta.cost)})
+ </span>
+ ) : usageMeta.available_in_plan && !usageMeta.unlimited && relativeToSubscription ? (
+ <span className="text-sm">{percentageLabel}</span>
+ ) : null}
+ </Link>
+ ) : (
+ <div className="block w-full">
+ <p className="text-sm text-foreground-light flex space-x-1">{metric.name}</p>
+ <span className="text-sm">{usageLabel}</span>&nbsp;
+ {relativeToSubscription && usageMeta.cost && usageMeta.cost > 0 ? (
+ <span className="text-sm" translate="no">
+ ({formatCurrency(usageMeta.cost)})
+ </span>
+ ) : usageMeta.available_in_plan && !usageMeta.unlimited && relativeToSubscription ? (
+ <span className="text-sm">{percentageLabel}</span>
+ ) : null}
+ </div>
+ )}
{usageMeta.available_in_plan ? (
<div>
@@ -156,7 +168,7 @@ const BillingMetric = ({
</div>
</HoverCardTrigger>
{usageMeta.available_in_plan && (
- <HoverCardContent side="bottom" align="center" className="w-[500px]" animate="slide-in">
+ <HoverCardContent side="bottom" align="end" className="w-[500px]" animate="slide-in">
<div className="text-sm">
<p className="font-medium" translate="no">
{usageMeta.unit_price_desc}
@@ -229,5 +241,3 @@ const BillingMetric = ({
</HoverCard>
)
}
-
-export default BillingMetric
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx
index 16f62d8614e..df14738bfd7 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx
@@ -3,20 +3,27 @@ import Link from 'next/link'
import { ComputeUsageMetric, PricingMetric } from 'data/analytics/org-daily-stats-query'
import type { OrgUsageResponse } from 'data/usage/org-usage-query'
import { formatCurrency } from 'lib/helpers'
+import { ChevronRight } from 'lucide-react'
import { useMemo } from 'react'
+import { HoverCard, HoverCardContent, HoverCardTrigger } from 'ui'
import { formatUsage } from '../helpers'
import { Metric } from './BillingBreakdown.constants'
-import { ChevronRight } from 'lucide-react'
-import { HoverCard, HoverCardContent, HoverCardTrigger } from 'ui'
export interface ComputeMetricProps {
slug?: string
metric: Metric
usage: OrgUsageResponse
relativeToSubscription: boolean
+ className?: string
}
-const ComputeMetric = ({ slug, metric, usage, relativeToSubscription }: ComputeMetricProps) => {
+export const ComputeMetric = ({
+ slug,
+ metric,
+ usage,
+ relativeToSubscription,
+ className,
+}: ComputeMetricProps) => {
const usageMeta = usage.usages.find((x) => x.metric === metric.key)
const usageLabel = useMemo(() => {
@@ -37,8 +44,8 @@ const ComputeMetric = ({ slug, metric, usage, relativeToSubscription }: ComputeM
return (
<HoverCard openDelay={50} closeDelay={200}>
- <HoverCardTrigger>
- <div>
+ <HoverCardTrigger asChild>
+ <div className={className}>
<Link href={`/org/${slug}/usage#${metric.anchor}`}>
<div className="group flex items-center space-x-2">
<p className="text-sm text-foreground-light group-hover:text-foreground transition cursor-pointer">
@@ -55,7 +62,7 @@ const ComputeMetric = ({ slug, metric, usage, relativeToSubscription }: ComputeM
) : null}
</div>
</HoverCardTrigger>
- <HoverCardContent side="bottom" align="center" className="w-[500px]" animate="slide-in">
+ <HoverCardContent side="bottom" align="end" className="w-[500px]" animate="slide-in">
<div className="text-sm text-foreground space-y-2">
<p className="font-medium" translate="no">
{usageMeta?.unit_price_desc}
@@ -126,5 +133,3 @@ const ComputeMetric = ({ slug, metric, usage, relativeToSubscription }: ComputeM
</HoverCard>
)
}
-
-export default ComputeMetric
diff --git a/apps/studio/components/interfaces/Organization/Usage/Compute.tsx b/apps/studio/components/interfaces/Organization/Usage/Compute.tsx
index e32c1458b89..581f0ed11dd 100644
--- a/apps/studio/components/interfaces/Organization/Usage/Compute.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/Compute.tsx
@@ -9,7 +9,7 @@ import { useOrgDailyComputeStatsQuery } from 'data/analytics/org-daily-compute-s
import { ComputeUsageMetric, computeUsageMetricLabel } from 'data/analytics/org-daily-stats-query'
import type { OrgSubscription } from 'data/subscriptions/types'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
-import SectionContent from './SectionContent'
+import { SectionContent } from './SectionContent'
import { Attribute, AttributeColor } from './Usage.constants'
import UsageBarChart from './UsageBarChart'
diff --git a/apps/studio/components/interfaces/Organization/Usage/SectionContent.tsx b/apps/studio/components/interfaces/Organization/Usage/SectionContent.tsx
index ebabba92a80..9d46db528eb 100644
--- a/apps/studio/components/interfaces/Organization/Usage/SectionContent.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/SectionContent.tsx
@@ -1,16 +1,16 @@
import { ScaffoldContainer, ScaffoldDivider } from 'components/layouts/Scaffold'
+import { ExternalLink } from 'lucide-react'
import Link from 'next/link'
import { PropsWithChildren } from 'react'
import { Badge } from 'ui'
import { CategoryAttribute } from './Usage.constants'
-import { ExternalLink } from 'lucide-react'
export interface SectionContent {
section: Pick<CategoryAttribute, 'name' | 'description' | 'links'>
includedInPlan?: boolean
}
-const SectionContent = ({
+export const SectionContent = ({
section,
includedInPlan,
children,
@@ -39,11 +39,13 @@ const SectionContent = ({
</div>
{links && links.length > 0 && (
<div className="space-y-2">
- <p className="text-sm text-foreground mb-2">More information</p>
+ <p className="text-xs font-mono uppercase text-foreground-lighter mb-2">
+ More information
+ </p>
{links.map((link) => (
<div key={link.url}>
<Link href={link.url} target="_blank" rel="noreferrer">
- <div className="flex items-center space-x-2 opacity-50 hover:opacity-100 transition">
+ <div className="inline-flex items-center space-x-2 text-foreground-light hover:text-foreground transition">
<p className="text-sm">{link.name}</p>
<ExternalLink size={16} strokeWidth={1.5} />
</div>
@@ -62,5 +64,3 @@ const SectionContent = ({
</>
)
}
-
-export default SectionContent
diff --git a/apps/studio/components/interfaces/Organization/Usage/SectionHeader.tsx b/apps/studio/components/interfaces/Organization/Usage/SectionHeader.tsx
index f896bf6d4be..06a345ea24a 100644
--- a/apps/studio/components/interfaces/Organization/Usage/SectionHeader.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/SectionHeader.tsx
@@ -1,11 +1,14 @@
+import { cn } from 'ui'
+
export interface SectionHeaderProps {
title: string
description: string
+ className?: string
}
-const SectionHeader = ({ title, description }: SectionHeaderProps) => {
+const SectionHeader = ({ title, description, className }: SectionHeaderProps) => {
return (
- <div className="mx-auto flex flex-col gap-10 py-14">
+ <div className={cn('mx-auto flex flex-col gap-10 py-14', className)}>
<div>
<p className="text-xl">{title}</p>
<p className="text-sm text-foreground-light">{description}</p>
diff --git a/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx b/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
index c6329db4280..3995d22d4a9 100644
--- a/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
@@ -12,9 +12,9 @@ import { useOrgUsageQuery } from 'data/usage/org-usage-query'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { cn } from 'ui'
import { BILLING_BREAKDOWN_METRICS } from '../BillingSettings/BillingBreakdown/BillingBreakdown.constants'
-import BillingMetric from '../BillingSettings/BillingBreakdown/BillingMetric'
-import ComputeMetric from '../BillingSettings/BillingBreakdown/ComputeMetric'
-import SectionContent from './SectionContent'
+import { BillingMetric } from '../BillingSettings/BillingBreakdown/BillingMetric'
+import { ComputeMetric } from '../BillingSettings/BillingBreakdown/ComputeMetric'
+import { SectionContent } from './SectionContent'
export interface ComputeProps {
orgSlug: string
@@ -58,7 +58,7 @@ export const TotalUsage = ({
})
// When the user filters by project ref or selects a custom timeframe, we only display usage+project breakdown, but no costs/limits
- const showRelationToSubscription = currentBillingCycleSelected && !projectRef
+ const showRelationToSubscription = currentBillingCycleSelected && projectRef === 'all-projects'
const hasExceededAnyLimits =
showRelationToSubscription &&
@@ -186,12 +186,15 @@ export const TotalUsage = ({
)}
<div className="grid grid-cols-12 mt-3">
{sortedBillingMetrics.map((metric, i) => {
+ const isLastBillingMetric = i === sortedBillingMetrics.length - 1
+ const isLastInRow = isLastBillingMetric && computeMetrics.length === 0
+
return (
<div
className={cn(
'col-span-12 md:col-span-6 space-y-4 py-4 border-overlay',
- i % 2 === 0 ? 'md:border-r md:pr-4' : 'md:pl-4',
- 'border-b'
+ i % 2 === 0 && 'md:border-r',
+ !isLastInRow && 'border-b'
)}
key={metric.key}
>
@@ -202,35 +205,41 @@ export const TotalUsage = ({
usage={usage}
subscription={subscription!}
relativeToSubscription={showRelationToSubscription}
+ className={cn(i % 2 === 0 ? 'md:pr-4' : 'md:pl-4')}
/>
</div>
)
})}
- {computeMetrics.map((metric, i) => (
- <div
- className={cn(
- 'col-span-12 md:col-span-6 space-y-4 py-4 border-overlay',
- (i + sortedBillingMetrics.length) % 2 === 0 ? 'md:border-r md:pr-4' : 'md:pl-4',
- 'border-b'
- )}
- key={metric}
- >
- <ComputeMetric
- slug={orgSlug}
- metric={{
- key: metric,
- name: computeUsageMetricLabel(metric) + ' Compute Hours' || metric,
- units: 'hours',
- anchor: 'compute',
- category: 'Compute',
- unitName: 'GB',
- }}
- relativeToSubscription={showRelationToSubscription}
- usage={usage}
- />
- </div>
- ))}
+ {computeMetrics.map((metric, i) => {
+ return (
+ <div
+ className={cn(
+ 'col-span-12 md:col-span-6 space-y-4 py-4 border-overlay',
+ (i + sortedBillingMetrics.length) % 2 === 0 && 'md:border-r',
+ 'border-b last:border-b-0'
+ )}
+ key={metric}
+ >
+ <ComputeMetric
+ slug={orgSlug}
+ metric={{
+ key: metric,
+ name: computeUsageMetricLabel(metric) + ' Compute Hours' || metric,
+ units: 'hours',
+ anchor: 'compute',
+ category: 'Compute',
+ unitName: 'GB',
+ }}
+ relativeToSubscription={showRelationToSubscription}
+ usage={usage}
+ className={cn(
+ (i + sortedBillingMetrics.length) % 2 === 0 ? 'md:pr-4' : 'md:pl-4'
+ )}
+ />
+ </div>
+ )
+ })}
</div>
</div>
)}
diff --git a/apps/studio/components/interfaces/Organization/Usage/Usage.tsx b/apps/studio/components/interfaces/Organization/Usage/Usage.tsx
index 506e02109f9..728c45750b9 100644
--- a/apps/studio/components/interfaces/Organization/Usage/Usage.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/Usage.tsx
@@ -4,11 +4,7 @@ import Link from 'next/link'
import { useEffect, useMemo, useState } from 'react'
import { useParams } from 'common'
-import {
- ScaffoldContainer,
- ScaffoldContainerLegacy,
- ScaffoldTitle,
-} from 'components/layouts/Scaffold'
+import { ScaffoldContainer, ScaffoldHeader, ScaffoldTitle } from 'components/layouts/Scaffold'
import AlertError from 'components/ui/AlertError'
import DateRangePicker from 'components/ui/DateRangePicker'
import NoPermission from 'components/ui/NoPermission'
@@ -18,7 +14,15 @@ import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-que
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { TIME_PERIODS_BILLING, TIME_PERIODS_REPORTS } from 'lib/constants/metrics'
-import { cn, Listbox } from 'ui'
+import {
+ cn,
+ Select_Shadcn_,
+ SelectContent_Shadcn_,
+ SelectGroup_Shadcn_,
+ SelectItem_Shadcn_,
+ SelectTrigger_Shadcn_,
+ SelectValue_Shadcn_,
+} from 'ui'
import { Admonition } from 'ui-patterns'
import { Restriction } from '../BillingSettings/Restriction'
import Activity from './Activity'
@@ -30,7 +34,7 @@ import { TotalUsage } from './TotalUsage'
const Usage = () => {
const { slug, projectRef } = useParams()
const [dateRange, setDateRange] = useState<any>()
- const [selectedProjectRef, setSelectedProjectRef] = useState<string>()
+ const [selectedProjectRef, setSelectedProjectRef] = useState<string | undefined>('all-projects')
const canReadSubscriptions = useCheckPermissions(
PermissionAction.BILLING_READ,
@@ -110,21 +114,33 @@ const Usage = () => {
if (!canReadSubscriptions) {
return (
- <ScaffoldContainerLegacy>
- <NoPermission resourceText="view organization usage" />
- </ScaffoldContainerLegacy>
+ <ScaffoldHeader>
+ <ScaffoldContainer>
+ <NoPermission resourceText="view organization usage" />
+ </ScaffoldContainer>
+ </ScaffoldHeader>
)
}
return (
<>
- <ScaffoldContainerLegacy>
- <ScaffoldTitle>Usage</ScaffoldTitle>
- </ScaffoldContainerLegacy>
- <div className="sticky top-0 border-b bg-studio z-[1] overflow-hidden ">
- <ScaffoldContainer className="">
+ <ScaffoldContainer>
+ <ScaffoldHeader>
+ <ScaffoldTitle>Usage</ScaffoldTitle>
+ </ScaffoldHeader>
+ </ScaffoldContainer>
+ <div className="sticky top-0 border-b bg-sidebar z-[1] overflow-hidden">
+ <ScaffoldContainer>
<div className="py-4 flex items-center space-x-4">
- {isLoadingSubscription && <ShimmeringLoader className="w-[250px]" />}
+ {isLoadingSubscription && (
+ <div className="flex lg:items-center items-start gap-3 flex-col lg:flex-row lg:justify-between w-full">
+ <div className="flex items-center gap-2">
+ <ShimmeringLoader className="w-48" />
+ <ShimmeringLoader className="w-48" />
+ </div>
+ <ShimmeringLoader className="w-[280px]" />
+ </div>
+ )}
{isErrorSubscription && (
<AlertError
@@ -135,70 +151,94 @@ const Usage = () => {
)}
{isSuccessSubscription && (
- <>
- <DateRangePicker
- onChange={setDateRange}
- value={TIME_PERIODS_BILLING[0].key}
- options={[...TIME_PERIODS_BILLING, ...TIME_PERIODS_REPORTS]}
- loading={isLoadingSubscription}
- currentBillingPeriodStart={subscription?.current_period_start}
- currentBillingPeriodEnd={subscription?.current_period_end}
- />
+ <div className="flex lg:items-center items-start gap-3 flex-col lg:flex-row lg:justify-between w-full">
+ <div className="flex items-center gap-2">
+ <DateRangePicker
+ onChange={setDateRange}
+ value={TIME_PERIODS_BILLING[0].key}
+ options={[...TIME_PERIODS_BILLING, ...TIME_PERIODS_REPORTS]}
+ loading={isLoadingSubscription}
+ currentBillingPeriodStart={subscription?.current_period_start}
+ currentBillingPeriodEnd={subscription?.current_period_end}
+ className="!w-48"
+ />
- <Listbox
- size="tiny"
- name="schema"
- className="w-[180px]"
- value={selectedProjectRef}
- onChange={(value: any) => {
- if (value === 'all-projects') setSelectedProjectRef(undefined)
- else setSelectedProjectRef(value)
- }}
- >
- <Listbox.Option
- key="all-projects"
- id="all-projects"
- label="All projects"
- value="all-projects"
+ <Select_Shadcn_
+ value={selectedProjectRef}
+ onValueChange={(value) => {
+ if (value === 'all-projects') setSelectedProjectRef('all-projects')
+ else setSelectedProjectRef(value)
+ }}
>
- All projects
- </Listbox.Option>
- {orgProjects?.map((project) => (
- <Listbox.Option
- key={project.ref}
- id={project.ref}
- value={project.ref}
- label={project.name}
- >
- {project.name}
- </Listbox.Option>
- ))}
- </Listbox>
+ <SelectTrigger_Shadcn_ size="tiny" className="w-[180px]">
+ <SelectValue_Shadcn_ placeholder="Select a project" />
+ </SelectTrigger_Shadcn_>
+ <SelectContent_Shadcn_>
+ <SelectGroup_Shadcn_>
+ <SelectItem_Shadcn_
+ key="all-projects"
+ value="all-projects"
+ className="text-xs"
+ >
+ All projects
+ </SelectItem_Shadcn_>
+ {orgProjects?.map((project) => (
+ <SelectItem_Shadcn_
+ key={project.ref}
+ value={project.ref}
+ className="text-xs"
+ >
+ {project.name}
+ </SelectItem_Shadcn_>
+ ))}
+ </SelectGroup_Shadcn_>
+ </SelectContent_Shadcn_>
+ </Select_Shadcn_>
+ </div>
- <div className="flex flex-col xl:flex-row xl:gap-3">
+ <div className="flex items-center gap-2">
<p className={cn('text-sm transition', isLoadingSubscription && 'opacity-50')}>
- Organization is on the {subscription.plan.name} plan
+ Organization is on the{' '}
+ <span className="font-medium text-brand">{subscription.plan.name} Plan</span>
</p>
+ <span className="text-border-stronger">
+ <svg
+ viewBox="0 0 24 24"
+ width="16"
+ height="16"
+ stroke="currentColor"
+ strokeWidth="1"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ fill="none"
+ shapeRendering="geometricPrecision"
+ >
+ <path d="M16 3.549L7.12 20.600" />
+ </svg>
+ </span>
<p className="text-sm text-foreground-light">
{billingCycleStart.format('DD MMM YYYY')} -{' '}
{billingCycleEnd.format('DD MMM YYYY')}
</p>
</div>
- </>
+ </div>
)}
</div>
</ScaffoldContainer>
</div>
- {selectedProjectRef ? (
+ {selectedProjectRef && selectedProjectRef !== 'all-projects' ? (
<ScaffoldContainer className="mt-5">
<Admonition
type="default"
title="Usage filtered by project"
description={
<div>
- You are currently viewing usage for the
- {selectedProject?.name || selectedProjectRef} project. Supabase uses{' '}
+ You are currently viewing usage for the{' '}
+ <span className="font-medium text-foreground">
+ {selectedProject?.name || selectedProjectRef}
+ </span>{' '}
+ project. Supabase uses{' '}
<Link
href="/docs/guides/platform/billing-on-supabase#organization-based-billing"
target="_blank"
diff --git a/apps/studio/components/interfaces/Organization/Usage/UsageSection/AttributeUsage.tsx b/apps/studio/components/interfaces/Organization/Usage/UsageSection/AttributeUsage.tsx
index 349cddc7f3e..49f2d8e761d 100644
--- a/apps/studio/components/interfaces/Organization/Usage/UsageSection/AttributeUsage.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/UsageSection/AttributeUsage.tsx
@@ -11,7 +11,7 @@ import type { OrgMetricsUsage, OrgUsageResponse } from 'data/usage/org-usage-que
import { USAGE_APPROACHING_THRESHOLD } from 'lib/constants'
import type { ResponseError } from 'types'
import { Button, cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
-import SectionContent from '../SectionContent'
+import { SectionContent } from '../SectionContent'
import { CategoryAttribute } from '../Usage.constants'
import {
ChartTooltipValueFormatter,
diff --git a/apps/studio/components/interfaces/Organization/Usage/UsageSection/DatabaseSizeUsage.tsx b/apps/studio/components/interfaces/Organization/Usage/UsageSection/DatabaseSizeUsage.tsx
index 76129eeb3cf..081a788cd13 100644
--- a/apps/studio/components/interfaces/Organization/Usage/UsageSection/DatabaseSizeUsage.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/UsageSection/DatabaseSizeUsage.tsx
@@ -1,25 +1,21 @@
-import AlertError from 'components/ui/AlertError'
-import ShimmeringLoader from 'components/ui/ShimmeringLoader'
+import Link from 'next/link'
+import { useMemo } from 'react'
+
+import Panel from 'components/ui/Panel'
+import { PricingMetric } from 'data/analytics/org-daily-stats-query'
import type { OrgSubscription } from 'data/subscriptions/types'
-import SectionContent from '../SectionContent'
-import { CategoryAttribute } from '../Usage.constants'
-import { useOrgProjectsQuery } from 'data/projects/org-projects'
-import { PROJECT_STATUS } from 'lib/constants'
+import { OrgUsageResponse } from 'data/usage/org-usage-query'
+import { formatBytes } from 'lib/helpers'
import {
- Button,
Alert_Shadcn_,
- CriticalIcon,
- AlertTitle_Shadcn_,
AlertDescription_Shadcn_,
+ AlertTitle_Shadcn_,
+ Button,
+ CriticalIcon,
} from 'ui'
-import MotionNumber from '@number-flow/react'
-import Link from 'next/link'
-import { useMemo } from 'react'
import { InfoTooltip } from 'ui-patterns/info-tooltip'
-import { OrgUsageResponse } from 'data/usage/org-usage-query'
-import { PricingMetric } from 'data/analytics/org-daily-stats-query'
-import Panel from 'components/ui/Panel'
-import { formatBytes } from 'lib/helpers'
+import { SectionContent } from '../SectionContent'
+import { CategoryAttribute } from '../Usage.constants'
export interface DatabaseSizeUsageProps {
slug: string
diff --git a/apps/studio/components/interfaces/Organization/Usage/UsageSection/DiskUsage.tsx b/apps/studio/components/interfaces/Organization/Usage/UsageSection/DiskUsage.tsx
index 0ac82809832..0d9449a6580 100644
--- a/apps/studio/components/interfaces/Organization/Usage/UsageSection/DiskUsage.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/UsageSection/DiskUsage.tsx
@@ -1,24 +1,25 @@
+import MotionNumber from '@number-flow/react'
+import Link from 'next/link'
+import { useMemo } from 'react'
+
import AlertError from 'components/ui/AlertError'
+import Panel from 'components/ui/Panel'
import ShimmeringLoader from 'components/ui/ShimmeringLoader'
-import type { OrgSubscription } from 'data/subscriptions/types'
-import SectionContent from '../SectionContent'
-import { CategoryAttribute } from '../Usage.constants'
+import { PricingMetric } from 'data/analytics/org-daily-stats-query'
import { useOrgProjectsQuery } from 'data/projects/org-projects'
+import type { OrgSubscription } from 'data/subscriptions/types'
+import { OrgUsageResponse } from 'data/usage/org-usage-query'
import { PROJECT_STATUS } from 'lib/constants'
import {
- Button,
Alert_Shadcn_,
- CriticalIcon,
- AlertTitle_Shadcn_,
AlertDescription_Shadcn_,
+ AlertTitle_Shadcn_,
+ Button,
+ CriticalIcon,
} from 'ui'
-import MotionNumber from '@number-flow/react'
-import Link from 'next/link'
-import { useMemo } from 'react'
import { InfoTooltip } from 'ui-patterns/info-tooltip'
-import { OrgUsageResponse } from 'data/usage/org-usage-query'
-import { PricingMetric } from 'data/analytics/org-daily-stats-query'
-import Panel from 'components/ui/Panel'
+import { SectionContent } from '../SectionContent'
+import { CategoryAttribute } from '../Usage.constants'
export interface DiskUsageProps {
slug: string
diff --git a/apps/studio/components/interfaces/Organization/Usage/UsageSection/UsageSection.tsx b/apps/studio/components/interfaces/Organization/Usage/UsageSection/UsageSection.tsx
index 0de7ab646da..e2327177cb3 100644
--- a/apps/studio/components/interfaces/Organization/Usage/UsageSection/UsageSection.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/UsageSection/UsageSection.tsx
@@ -46,11 +46,13 @@ const UsageSection = ({
return (
<>
<ScaffoldContainer>
- <SectionHeader title={categoryMeta.name} description={categoryMeta.description} />
+ <SectionHeader
+ title={categoryMeta.name}
+ description={categoryMeta.description}
+ className="pb-0"
+ />
</ScaffoldContainer>
- <ScaffoldDivider />
-
{categoryMeta.attributes.map((attribute) =>
attribute.key === 'diskSize' ? (
<DiskUsage