Skip to content

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

Adds new total active and total paused projects fields from api

Terry Sutton797bf8a5f62b
diff --git a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
index cd4433382c9..c8a1f10e6a9 100644
--- a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
+++ b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
@@ -4,7 +4,7 @@ import { Button, IconAlertCircle, IconPauseCircle } from '@supabase/ui'
import { Project } from 'types'
import Link from '@supabase/ui/dist/cjs/components/Typography/Link'
import router from 'next/router'
-import { useStore } from 'hooks'
+import { useStore, useSubscriptionStats } from 'hooks'
import { DEFAULT_FREE_PROJECTS_LIMIT } from 'lib/constants'
interface Props {
@@ -15,7 +15,9 @@ const ProjectPausedState: FC<Props> = ({ project }) => {
const [isSubmitting, setIsSubmitting] = useState(false)
const { ref } = router.query
const { ui } = useStore()
+ const subscriptionStats = useSubscriptionStats()
const freeProjectsLimit = ui.profile?.free_project_limit ?? DEFAULT_FREE_PROJECTS_LIMIT
+ console.log(subscriptionStats)
return (
<>
diff --git a/studio/hooks/queries/useSubscriptionStats.ts b/studio/hooks/queries/useSubscriptionStats.ts
index 42bd7dad73d..e109b160077 100644
--- a/studio/hooks/queries/useSubscriptionStats.ts
+++ b/studio/hooks/queries/useSubscriptionStats.ts
@@ -5,6 +5,8 @@ import { API_URL } from 'lib/constants'
export interface SubscriptionStats {
total_paid_projects: number
total_free_projects: number
+ total_active_free_projects: number
+ total_paused_free_projects: number
total_pro_projects: number
total_payg_projects: number
}
@@ -16,7 +18,9 @@ export function useSubscriptionStats() {
return {
total_paid_projects: data?.total_paid_projects ?? 0,
- total_free_projects: data?.total_free_projects ?? 0, // set this to force limit locally
+ total_free_projects: data?.total_free_projects ?? 0,
+ total_active_free_projects: data?.total_active_free_projects ?? 0,
+ total_paused_free_projects: data?.total_paused_free_projects ?? 0,
total_pro_projects: data?.total_pro_projects ?? 0,
total_payg_projects: data?.total_payg_projects ?? 0,
isLoading: !anyError && !data,