mirror of
https://github.com/supabase/supabase.git
synced 2026-07-07 11:40:20 +08:00
20 lines
814 B
TypeScript
20 lines
814 B
TypeScript
import { IS_PLATFORM } from 'lib/constants'
|
|
import type { OrgSubscription, ProjectSelectedAddon } from 'data/subscriptions/types'
|
|
|
|
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'
|
|
)
|
|
}
|