Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / components / containers / app / StandalonePublicApp.tsx
blob86ed89ba98b5f69eeca920a435264ca6e1135f1e
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';
13 interface Props {
14     onLogin: OnLoginCallback;
15     locales: TtagLocaleMap;
18 const UnleashFlagProviderWrapper = ({ children }: { children: ReactNode }) => {
19     const api = useApi();
20     return <UnleashFlagProvider api={api}>{children}</UnleashFlagProvider>;
23 const StandalonePublicApp = ({ onLogin, locales }: Props) => {
24     const loaderPage = <LoaderPage />;
25     return (
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} />
32                         </div>
33                     </div>
34                 </UnleashFlagProviderWrapper>
35             </UnAuthenticatedApiProvider>
36         </StandardPublicApp>
37     );
40 export default StandalonePublicApp;