Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / components / containers / otherMailPreferences / OtherMailPreferencesSection.tsx
blob0af5960113750b8ef3f858163910dd7585de6b1d
1 import { useOrganization } from '@proton/account/organization/hooks';
2 import { useUser } from '@proton/account/user/hooks';
3 import { FeatureCode, useFeature } from '@proton/features';
4 import { isElectronMail } from '@proton/shared/lib/helpers/desktop';
5 import { getIsB2BAudienceFromPlan } from '@proton/shared/lib/helpers/subscription';
7 import { KeyboardShortcut } from './KeyboardShortcut';
8 import { SenderImages } from './SenderImages';
9 import { TipsAndInsights } from './TipsAndInsights';
10 import { UnreadFaviconCounter } from './UnreadFaviconCounter';
12 export const OtherMailPreferencesSection = () => {
13     const isUnreadFaviconEnabled = !!useFeature(FeatureCode.UnreadFavicon).feature?.Value;
14     const [organization] = useOrganization();
15     const [user] = useUser();
17     const isB2BAudience = getIsB2BAudienceFromPlan(organization?.PlanName);
18     const canToggleTips = user.isPaid && !isB2BAudience;
20     return (
21         <>
22             <KeyboardShortcut />
23             <SenderImages />
24             {isUnreadFaviconEnabled && !isElectronMail && <UnreadFaviconCounter />}
25             {canToggleTips && <TipsAndInsights />}
26         </>
27     );