mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-09-09 07:08:20 +00:00
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import { Provider } from 'react-redux';
|
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
import { AuthProvider } from '@tria-plc/iamui-common';
|
|
import { AuthConfigProvider } from '@ema-platform/auth';
|
|
import type { ReactNode } from 'react';
|
|
import { store } from '../store';
|
|
import { MantineThemeProvider } from './MantineThemeProvider';
|
|
import { ErrorBoundary } from '../components/ErrorBoundary';
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: { queries: { retry: 1, staleTime: 1000 * 60 * 5 } },
|
|
});
|
|
|
|
export function AppProviders({ children }: { children: ReactNode }) {
|
|
return (
|
|
<ErrorBoundary>
|
|
<Provider store={store}>
|
|
<QueryClientProvider client={queryClient}>
|
|
<AuthProvider>
|
|
<AuthConfigProvider
|
|
value={{
|
|
appName: 'Portal',
|
|
storagePrefix: 'ema-portal',
|
|
loginRedirectPath: '/dashboard',
|
|
enableSignup: true,
|
|
enableForgotPassword: true,
|
|
}}
|
|
>
|
|
<MantineThemeProvider>{children}</MantineThemeProvider>
|
|
</AuthConfigProvider>
|
|
</AuthProvider>
|
|
</QueryClientProvider>
|
|
</Provider>
|
|
</ErrorBoundary>
|
|
);
|
|
}
|