Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: Alex van Andel <[email protected]> Co-authored-by: zomars <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Benny Joo <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: Gergő Móricz <[email protected]> Co-authored-by: Keith Williams <[email protected]>
13 lines
418 B
TypeScript
13 lines
418 B
TypeScript
import type { AppFlags } from "@calcom/features/flags/config";
|
|
import { trpc } from "@calcom/trpc/react";
|
|
|
|
const initialData: Partial<AppFlags> = process.env.NEXT_PUBLIC_IS_E2E
|
|
? { "managed-event-types": true, organizations: true, teams: true }
|
|
: {};
|
|
export function useFlags(): Partial<AppFlags> {
|
|
const query = trpc.viewer.features.map.useQuery(undefined, {
|
|
initialData,
|
|
});
|
|
return query.data ?? {};
|
|
}
|