@selfcommunity/react-core
Version:
React Core Components useful for integrating UI Community components (react-ui).
23 lines (22 loc) • 778 B
TypeScript
import { SCFeatureName } from '@selfcommunity/types';
/**
* Custom hook to check if the feature is enabled
* @param featureName - feature name
* @returns boolean - true if the feature is in the list of features
*
* Ex.
* const isTaggingEnabled = useSCFeatureEnabled(SCFeatureName.TAGGING);
*/
export declare function useSCFeatureEnabled(featureName: SCFeatureName): boolean;
/**
* Custom hook to check if a list of features are enabled
* @param featureNames - feature names
* @returns boolean - true if all features are in the features list
*
* Ex.
* const hasRequiredFeatures = useSCFeaturesEnabled([
* SCFeatureName.TAGGING,
* SCFeatureName.GROUPING
* ]);
*/
export declare function useSCFeaturesEnabled(featureNames: SCFeatureName[]): boolean;