Merge branch 'DRVDOC-1260' into 'main'
[ProtonMail-WebClient.git] / packages / components / containers / publicAppSetup / PublicAppSetup.tsx
blobfeac2328e42e043354ff7c3d9fcd227f11cb9547
1 import type { ReactNode } from 'react';
2 import { useEffect } from 'react';
4 import useApi from '@proton/components/hooks/useApi';
5 import { useInboxDesktopMetrics } from '@proton/components/hooks/useInboxDesktopMetrics';
6 import { getInboxDesktopInfo, hasInboxDesktopFeature } from '@proton/shared/lib/desktop/ipcHelpers';
7 import { reportClientLaunch } from '@proton/shared/lib/desktop/reportClientLaunch';
8 import { isElectronMail } from '@proton/shared/lib/helpers/desktop';
10 interface Props {
11     children: ReactNode;
14 const PublicAppSetup = ({ children }: Props) => {
15     const api = useApi();
17     useEffect(() => {
18         if (isElectronMail && hasInboxDesktopFeature('InstallSource')) {
19             void reportClientLaunch(getInboxDesktopInfo('installSource'), 'mail', api);
20         }
21     }, []);
23     useInboxDesktopMetrics();
25     return children;
28 export default PublicAppSetup;