Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / components / hooks / useMozillaCheck.ts
blobd208261ddce2821dd9661fffed79ff7661dd6664
1 import { useSubscription } from '@proton/account/subscription/hooks';
2 import { isFreeSubscription } from '@proton/payments';
4 const useMozillaCheck = (): [isManagedByMozilla: boolean, loading: boolean] => {
5     const [subscription, loading] = useSubscription();
7     let isManagedByMozilla = false;
8     if (!loading && !isFreeSubscription(subscription)) {
9         isManagedByMozilla = !!subscription?.isManagedByMozilla;
10     }
12     return [isManagedByMozilla, loading];
15 export default useMozillaCheck;