mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 19:05:06 +03:00
* upgrade dialog changes * plan upgrade modal * update dialog improvements * factor in customer balance * copy * add PH a/b test * fix ts * smol stuff * fixes * group compute fees * smol edits * Update SubscriptionPlanUpdateDialog.tsx * Update SubscriptionPlanUpdateDialog.tsx * partner billing * downgrade * margin * show pricing info + filter out long tweets * fix tooltip --------- Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import type { OrgSubscription, ProjectSelectedAddon } from 'data/subscriptions/types'
|
|
import { IS_PLATFORM } from 'lib/constants'
|
|
|
|
export const getAddons = (selectedAddons: ProjectSelectedAddon[]) => {
|
|
const computeInstance = selectedAddons.find((addon) => addon.type === 'compute_instance')
|
|
const pitr = selectedAddons.find((addon) => addon.type === 'pitr')
|
|
const customDomain = selectedAddons.find((addon) => addon.type === 'custom_domain')
|
|
const ipv4 = selectedAddons.find((addon) => addon.type === 'ipv4')
|
|
|
|
return { computeInstance, pitr, customDomain, ipv4 }
|
|
}
|
|
|
|
export const subscriptionHasHipaaAddon = (subscription?: OrgSubscription): boolean => {
|
|
if (!IS_PLATFORM) return false
|
|
|
|
return (subscription?.addons ?? []).some(
|
|
(addon) => addon.supabase_prod_id === 'addon_security_hipaa'
|
|
)
|
|
}
|
|
|
|
export const billingPartnerLabel = (billingPartner?: string) => {
|
|
if (!billingPartner) return billingPartner
|
|
|
|
switch (billingPartner) {
|
|
case 'fly':
|
|
return 'Fly.io'
|
|
case 'aws':
|
|
return 'AWS'
|
|
case 'vercel_marketplace':
|
|
return 'Vercel'
|
|
default:
|
|
return billingPartner
|
|
}
|
|
}
|