Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / components / hooks / useIsElectronApp.ts
bloba079e9c1d15b45d347ed1a6f25c690e157088233
1 import {
2     SUPPORTED_ELECTRON_APP,
3     isElectronApp,
4     isElectronOnMac,
5     isElectronOnWindows,
6 } from '@proton/shared/lib/helpers/desktop';
7 import { type FeatureFlag, useFlag } from '@proton/unleash';
9 import useConfig from './useConfig';
11 const useIsElectronApp = (flag: FeatureFlag) => {
12     const { APP_NAME } = useConfig();
14     const electronFlag = useFlag(flag);
15     const isElectronDisabled = isElectronApp && electronFlag;
16     const isSupportedElectronApp = SUPPORTED_ELECTRON_APP.includes(APP_NAME);
18     return {
19         isElectron: isElectronApp,
20         isElectronDisabled,
21         isElectronEnabled: !isElectronDisabled,
22         isElectronOnMac: isElectronOnMac,
23         isElectronOnWindows: isElectronOnWindows,
24         isSupportedElectronApp,
25     };
28 export default useIsElectronApp;