Files
bakery-ia/frontend/src/App.tsx

63 lines
2.0 KiB
TypeScript
Raw Normal View History

2025-08-28 10:41:04 +02:00
import { Suspense } from 'react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { BrowserRouter } from 'react-router-dom';
2025-08-03 19:23:20 +02:00
import { Toaster } from 'react-hot-toast';
2025-08-28 10:41:04 +02:00
import { ErrorBoundary } from './components/shared/ErrorBoundary';
import { LoadingSpinner } from './components/shared/LoadingSpinner';
import { AppRouter } from './router/AppRouter';
import { ThemeProvider } from './contexts/ThemeContext';
import { AuthProvider } from './contexts/AuthContext';
import { SSEProvider } from './contexts/SSEContext';
2025-09-21 13:27:50 +02:00
import GlobalSubscriptionHandler from './components/auth/GlobalSubscriptionHandler';
import './i18n';
2025-08-11 07:01:08 +02:00
2025-08-28 10:41:04 +02:00
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 5 * 60 * 1000,
gcTime: 10 * 60 * 1000,
retry: 3,
refetchOnWindowFocus: false,
},
},
});
2025-08-03 19:23:20 +02:00
2025-08-28 10:41:04 +02:00
function App() {
2025-08-16 20:13:40 +02:00
return (
<ErrorBoundary>
2025-08-28 10:41:04 +02:00
<QueryClientProvider client={queryClient}>
<BrowserRouter
future={{
v7_startTransition: true,
v7_relativeSplatPath: true,
}}
>
2025-08-28 10:41:04 +02:00
<ThemeProvider>
<AuthProvider>
2025-08-31 22:14:05 +02:00
<SSEProvider>
<Suspense fallback={<LoadingSpinner overlay />}>
<AppRouter />
2025-09-21 13:27:50 +02:00
<GlobalSubscriptionHandler />
2025-08-31 22:14:05 +02:00
<Toaster
position="top-right"
toastOptions={{
duration: 4000,
style: {
background: '#363636',
color: '#fff',
},
}}
/>
</Suspense>
</SSEProvider>
2025-08-28 10:41:04 +02:00
</AuthProvider>
</ThemeProvider>
</BrowserRouter>
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
2025-08-16 20:13:40 +02:00
</ErrorBoundary>
);
2025-08-28 10:41:04 +02:00
}
2025-08-03 19:23:20 +02:00
export default App;