mirror of
https://github.com/supabase/supabase.git
synced 2026-05-08 01:40:13 -04:00
cab0585533
* Replace all usage of useProjectContext with useSelectedProjectQuery * Replace all usage of useSelectedProject with useSelectedProjectQuery * Replace all usage of useProjectByRef with useProjectByRefQuery * Replace all usage of useSelectedOrganization with useSelectedOrganizationQuery * Deprecate useSelectedProject, useSelectedOrganization, and useProjectByRef hooks * Deprecate ProjecContext
22 lines
488 B
TypeScript
22 lines
488 B
TypeScript
import { useSelectedOrganizationQuery } from './useSelectedOrganization'
|
|
|
|
export function useCurrentOrgPlan() {
|
|
const { data: currentOrg } = useSelectedOrganizationQuery()
|
|
|
|
if (!currentOrg) {
|
|
return {
|
|
plan: null,
|
|
usageBillingEnabled: null,
|
|
isLoading: true,
|
|
isSuccess: false,
|
|
}
|
|
} else {
|
|
return {
|
|
plan: currentOrg?.plan,
|
|
usageBillingEnabled: currentOrg?.usage_billing_enabled,
|
|
isLoading: false,
|
|
isSuccess: true,
|
|
}
|
|
}
|
|
}
|