Files
Joshen Lim d78f6a1678 Set up feature for ETL + Analytics Buckets private alpha (#40523)
* Set up feature for ETL + Analytics Buckets private alpha

* Nit

* Add override

* Remove console log

* Update feature flag logic
2025-11-18 17:49:46 +08:00

20 lines
654 B
TypeScript

import { useFlag } from 'common'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
/**
* Organization level opt in for ETL private alpha
*/
export const useIsETLPrivateAlpha = () => {
const { data: organization } = useSelectedOrganizationQuery()
const etlPrivateAlpha = useFlag('etlPrivateAlpha')
const privateAlphaProjectRefs =
typeof etlPrivateAlpha === 'string'
? (etlPrivateAlpha as string).split(',').map((x) => x.trim())
: []
const etlShowForAllProjects = useFlag('etlPrivateAlphaOverride')
return etlShowForAllProjects || privateAlphaProjectRefs.includes(organization?.slug ?? '')
}