1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
unleash.unleash/frontend/src/hooks/useChangeRequestsEnabled.ts

11 lines
396 B
TypeScript
Raw Normal View History

import useUiConfig from './api/getters/useUiConfig/useUiConfig';
export const useChangeRequestsEnabled = (environment?: string) => {
// it can be swapped with proper settings instead of feature flag
const { uiConfig } = useUiConfig();
return (
Boolean(uiConfig?.flags?.changeRequests) &&
(environment === 'production' || typeof environment === 'undefined')
);
};