Migrate to a monorepo structure (#2909)
This commit is contained in:
@ -0,0 +1,17 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
||||
|
||||
export const useIsFeatureEnabled = (featureKey: string): boolean => {
|
||||
const currentWorkspace = useRecoilValue(currentWorkspaceState);
|
||||
|
||||
const featureFlag = currentWorkspace?.featureFlags?.find(
|
||||
(flag) => flag.key === featureKey,
|
||||
);
|
||||
|
||||
if (!featureFlag) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return featureFlag.value;
|
||||
};
|
||||
Reference in New Issue
Block a user