1 import type { ReactNode } from 'react';
3 import LoaderPage from '@proton/components/containers/app/LoaderPage';
4 import useApi from '@proton/components/hooks/useApi';
5 import type { TtagLocaleMap } from '@proton/shared/lib/interfaces/Locale';
6 import { UnleashFlagProvider } from '@proton/unleash';
8 import UnAuthenticatedApiProvider from '../api/UnAuthenticatedApiProvider';
9 import MinimalLoginContainer from '../login/MinimalLoginContainer';
10 import StandardPublicApp from './StandardPublicApp';
11 import type { OnLoginCallback } from './interface';
14 onLogin: OnLoginCallback;
15 locales: TtagLocaleMap;
18 const UnleashFlagProviderWrapper = ({ children }: { children: ReactNode }) => {
20 return <UnleashFlagProvider api={api}>{children}</UnleashFlagProvider>;
23 const StandalonePublicApp = ({ onLogin, locales }: Props) => {
24 const loaderPage = <LoaderPage />;
26 <StandardPublicApp loader={loaderPage} locales={locales}>
27 <UnAuthenticatedApiProvider>
28 <UnleashFlagProviderWrapper>
29 <div className="h-full flex justify-center items-center">
30 <div className="w-custom" style={{ '--w-custom': '20em' }}>
31 <MinimalLoginContainer onLogin={onLogin} />
34 </UnleashFlagProviderWrapper>
35 </UnAuthenticatedApiProvider>
40 export default StandalonePublicApp;