mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
10 lines
289 B
TypeScript
10 lines
289 B
TypeScript
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||
|
|
||
|
type flags = ReturnType<typeof useUiConfig>['uiConfig']['flags'];
|
||
|
|
||
|
export const useUiFlag = <K extends keyof flags>(flag: K) => {
|
||
|
const { uiConfig } = useUiConfig();
|
||
|
|
||
|
return uiConfig?.flags?.[flag] || false;
|
||
|
};
|