@stolostron/multicluster-sdk
Version:
Provides extensions and APIs that dynamic plugins can use to leverage multicluster capabilities provided by Red Hat Advanced Cluster Management.
20 lines • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.useIsFleetAvailable = void 0;
/* Copyright Contributors to the Open Cluster Management project */
const dynamic_plugin_sdk_1 = require("@openshift-console/dynamic-plugin-sdk");
const constants_1 = require("./constants");
/**
* Hook that determines if the fleet support is available.
*
* Checks if the feature flag with the name corresponding to the `REQUIRED_PROVIDER_FLAG` constant is enabled.
* Red Hat Advanced Cluster Management enables this feature flag in versions that provide all of the dependencies
* required by this version of the multicluster SDK.
*
* @returns `true` if a version of Red Hat Advanced Cluster Management that is compatible with the multicluster SDK is available; `false` otherwise
*/
const useIsFleetAvailable = () => {
return !!(0, dynamic_plugin_sdk_1.useFlag)(constants_1.REQUIRED_PROVIDER_FLAG);
};
exports.useIsFleetAvailable = useIsFleetAvailable;
//# sourceMappingURL=useIsFleetAvailable.js.map