mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-23 15:33:52 +00:00
Company Brain workspaces could only buy Scale at $399/mo, which is roughly eight times what the median team uses. Adds the $100/mo Max card to the Company Brain plan picker, notes what a Scale trial loses on the way down, and flags that Scale is cheaper above about $400/mo of credits.
22 lines
874 B
TypeScript
22 lines
874 B
TypeScript
import { useCustomer } from "autumn-js/react"
|
|
import { hasActivePlan } from "@lib/queries"
|
|
import { useHasCompanyBrain } from "@/hooks/use-company-brain"
|
|
|
|
// Connector entitlement (pro tier or company_brain) — mirrors backend canAccessConnector. Not for plugins.
|
|
export function useConnectorAccess(opts?: { enabled?: boolean }) {
|
|
const enabled = opts?.enabled ?? true
|
|
const autumn = useCustomer({ queryOptions: { enabled } })
|
|
const hasCompanyBrain = useHasCompanyBrain()
|
|
const hasPro = enabled && hasActivePlan(autumn.data?.subscriptions, "api_pro")
|
|
const hasMax = enabled && hasActivePlan(autumn.data?.subscriptions, "api_max")
|
|
const hasScale =
|
|
enabled && hasActivePlan(autumn.data?.subscriptions, "api_scale")
|
|
return {
|
|
hasPro,
|
|
hasMax,
|
|
hasScale,
|
|
hasCompanyBrain,
|
|
connectorAccess: hasPro || hasCompanyBrain,
|
|
loading: enabled && autumn.isLoading,
|
|
}
|
|
}
|