import { useBillingStore } from '@/store/billingStore' /** * Returns whether a feature flag is enabled for the current account. * * Reads from `useBillingStore.enabledFeatures`, which is populated by * `GET /billing/state`. Returns `false` when the flag is absent (closed-by-default). * * The hook subscribes to the store so updates from `refetch()` propagate * without manual refetch in the component. */ export function useFeature(flagKey: string): boolean { return useBillingStore((state) => Boolean(state.enabledFeatures[flagKey])) } export default useFeature