Skip to content

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

Fixes the billing cycle dropdown

Terry Sutton00e6da9450d4
diff --git a/studio/components/interfaces/Billing/PAYGUsage/PAYGUsage.tsx b/studio/components/interfaces/Billing/PAYGUsage/PAYGUsage.tsx
index 0ddc5682fe1..0d089d87ec5 100644
--- a/studio/components/interfaces/Billing/PAYGUsage/PAYGUsage.tsx
+++ b/studio/components/interfaces/Billing/PAYGUsage/PAYGUsage.tsx
@@ -7,15 +7,19 @@ import { ChargeableProduct, PaygStats, ProductFeature } from './PAYGUsage.types'
import { deriveProductCost } from './PAYGUsage.utils'
import { chargeableProducts } from './PAYGUsage.constants'
import { DATE_FORMAT } from 'lib/constants'
-import { Dictionary } from '@supabase/grid'
interface Props {
- paygStats: PaygStats
+ paygStats: PaygStats,
+ dateRange: {
+ period_start: {date: string, time_period: string}
+ period_end: {date: string, time_period: string}
+ interval: string
+ }
}
-const PAYGUsage: FC<Props> = ({ paygStats }) => {
- const startDate = dayjs().utc().startOf('month').format(DATE_FORMAT)
- const endDate = dayjs().utc().endOf('month').format(DATE_FORMAT)
+const PAYGUsage: FC<Props> = ({ paygStats, dateRange }) => {
+ const startDate = dateRange.period_start.date ?? dayjs().utc().startOf('month').format(DATE_FORMAT)
+ const endDate = dateRange.period_end.date ?? dayjs().utc().endOf('month').format(DATE_FORMAT)
return (
<div className="flex flex-col">
diff --git a/studio/components/to-be-cleaned/Charts/ChartRenderer.tsx b/studio/components/to-be-cleaned/Charts/ChartRenderer.tsx
index 0733e94b6f7..5a95aa00ade 100644
--- a/studio/components/to-be-cleaned/Charts/ChartRenderer.tsx
+++ b/studio/components/to-be-cleaned/Charts/ChartRenderer.tsx
@@ -8,6 +8,7 @@ import {
XAxis,
YAxis,
Tooltip,
+ ReferenceLine,
Cell,
ResponsiveContainer,
} from 'recharts'
@@ -279,6 +280,8 @@ export function BarChart({
/>
))}
</Bar>
+
+ <ReferenceLine y={8000000000} label="8GB Included" stroke="red" strokeDasharray="3 3" />
</RechartBarChart>
</ResponsiveContainer>
{data && (
diff --git a/studio/pages/project/[ref]/settings/billing/index.tsx b/studio/pages/project/[ref]/settings/billing/index.tsx
index 7239867bb1a..cb00ccbb067 100644
--- a/studio/pages/project/[ref]/settings/billing/index.tsx
+++ b/studio/pages/project/[ref]/settings/billing/index.tsx
@@ -105,7 +105,7 @@ const Settings: FC<SettingsProps> = ({ project }) => {
</div>
)}
</div>
- {paygStats && <PAYGUsage paygStats={paygStats} />}
+ {paygStats && <PAYGUsage paygStats={paygStats} dateRange={dateRange} />}
</div>
) : (
<ProjectUsage projectRef={project.ref} subscription_id={project.subscription_id} />