supermemory/apps/web/hooks/use-company-brain.ts
MaheshtheDev c0eb81c887 refactor(brain): one isCompanyBrainOrg helper in the web app (#1535)
Two hand-rolled copies of the add-on/brainMode rule replaced by a single shared helper, and the one-line isCompanyBrainOrganization wrapper dropped. No behaviour change.
2026-08-18 23:13:12 +00:00

8 lines
294 B
TypeScript

import { useAuth } from "@lib/auth-context"
import { isCompanyBrainOrg } from "@/lib/billing-utils"
export function useHasCompanyBrain(): boolean {
const { org } = useAuth()
const metadata = org?.metadata as Record<string, unknown> | string | undefined
return isCompanyBrainOrg(metadata)
}