debian-image-builder-frontend/src/Utilities/useGetEnvironment.js
lucasgarfield 7bca4c7438 LandingPage/ImagesTable/Wizard: Remove all insights global calls
This commit replaces all calls to the insights.chrome global with calls
to the useChrome() hook (or the useGetEnvironment() custom hook that
wraps useChrome()).
2023-04-28 17:07:31 +02:00

10 lines
392 B
JavaScript

import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
export const useGetEnvironment = () => {
const { isBeta, isProd, getEnvironment } = useChrome();
// Expose beta features in the ephemeral environment
if (isBeta() || getEnvironment() === 'qa') {
return { isBeta: () => true, isProd: isProd };
}
return { isBeta: () => false, isProd: isProd };
};