mirror of
https://github.com/supabase/supabase.git
synced 2026-10-18 15:49:09 +03:00
* chore: cleanup packages - Avoid circular imports - Export API-types as types - pg-format without depending on Node internal Buffer (not browser-compatible) - Avoid importing from barrel files in ui dir * chore: avoid barrel file imports in studio (#27771) * chore: avoid barrel file imports - Removes some unused imports - Avoids barrel file import for faster builds + less memory * add eslint rule * type fixes * delete layouts barrel * delete components/grid barrel file * delete components/grid/utils barrel file * delete components/grid/components/common barrel file * delete components/grid/components/editor barrel file * delete components/grid/components/formatter barrel file * delete components/grid/components/grid barrel file * delete components/grid/components/header/filter barrel file * remote components/grid/store barrel file * remove components/interfaces/Auth/Policies barrel file * delete components/interfaces/Settings/Logs barrel file * delete components/ui/CodeEditor barrel file * delete components/ui/Forms barrel file * delete components/ui/Shimmers barrel file * delete data/analytics barrel file * delete hooks barrel file * cleanup lib/common/fetch barrel file * final * barral files cleanup * global react-data-grid styles * remove console.log --------- Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com> * fix build --------- Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
94 lines
2.7 KiB
TypeScript
94 lines
2.7 KiB
TypeScript
import { useParams } from 'common'
|
|
import { ScaffoldContainer, ScaffoldDivider } from 'components/layouts/Scaffold'
|
|
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
|
|
import { useOrgSubscriptionQuery } from '../../../../data/subscriptions/org-subscription-query'
|
|
import BillingAddress from './BillingAddress/BillingAddress'
|
|
import BillingBreakdown from './BillingBreakdown/BillingBreakdown'
|
|
import BillingEmail from './BillingEmail'
|
|
import CostControl from './CostControl/CostControl'
|
|
import CreditBalance from './CreditBalance'
|
|
import PaymentMethods from './PaymentMethods/PaymentMethods'
|
|
import Subscription from './Subscription/Subscription'
|
|
import TaxID from './TaxID/TaxID'
|
|
|
|
const BillingSettings = () => {
|
|
const {
|
|
billingAccountData: isBillingAccountDataEnabledOnProfileLevel,
|
|
billingPaymentMethods: isBillingPaymentMethodsEnabledOnProfileLevel,
|
|
billingCredits: isBillingCreditsEnabledOnProfileLevel,
|
|
} = useIsFeatureEnabled(['billing:account_data', 'billing:payment_methods', 'billing:credits'])
|
|
|
|
const { slug: orgSlug } = useParams()
|
|
const { data: subscription } = useOrgSubscriptionQuery({ orgSlug })
|
|
const isNotOrgWithPartnerBilling = !subscription?.billing_via_partner ?? true
|
|
|
|
const billingAccountDataEnabled =
|
|
isBillingAccountDataEnabledOnProfileLevel && isNotOrgWithPartnerBilling
|
|
const billingPaymentMethodsEnabled =
|
|
isBillingPaymentMethodsEnabledOnProfileLevel && isNotOrgWithPartnerBilling
|
|
|
|
return (
|
|
<>
|
|
<ScaffoldContainer id="subscription">
|
|
<Subscription />
|
|
</ScaffoldContainer>
|
|
|
|
<ScaffoldDivider />
|
|
|
|
<ScaffoldContainer id="cost-control">
|
|
<CostControl />
|
|
</ScaffoldContainer>
|
|
|
|
<ScaffoldDivider />
|
|
|
|
<ScaffoldContainer id="breakdown">
|
|
<BillingBreakdown />
|
|
</ScaffoldContainer>
|
|
|
|
{isBillingCreditsEnabledOnProfileLevel && (
|
|
<>
|
|
<ScaffoldDivider />
|
|
|
|
<ScaffoldContainer id="credits-balance">
|
|
<CreditBalance />
|
|
</ScaffoldContainer>
|
|
</>
|
|
)}
|
|
|
|
{billingPaymentMethodsEnabled && (
|
|
<>
|
|
<ScaffoldDivider />
|
|
|
|
<ScaffoldContainer id="payment-methods">
|
|
<PaymentMethods />
|
|
</ScaffoldContainer>
|
|
</>
|
|
)}
|
|
|
|
{billingAccountDataEnabled && (
|
|
<>
|
|
<ScaffoldDivider />
|
|
|
|
<ScaffoldContainer id="email">
|
|
<BillingEmail />
|
|
</ScaffoldContainer>
|
|
|
|
<ScaffoldDivider />
|
|
|
|
<ScaffoldContainer id="address">
|
|
<BillingAddress />
|
|
</ScaffoldContainer>
|
|
|
|
<ScaffoldDivider />
|
|
|
|
<ScaffoldContainer id="taxId">
|
|
<TaxID />
|
|
</ScaffoldContainer>
|
|
</>
|
|
)}
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default BillingSettings
|