-
Notifications
You must be signed in to change notification settings - Fork 428
Expand file tree
/
Copy pathApp.tsx
More file actions
45 lines (40 loc) · 1.42 KB
/
App.tsx
File metadata and controls
45 lines (40 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { AuthProvider } from '@/contexts/AuthProvider';
import { TooltipProvider } from './components/ui/tooltip';
import { Toaster } from './components/ui/toaster';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { Outlet } from '@tanstack/react-router';
import { MeshFilesProvider } from '@/contexts/MeshFilesContext';
import { PostHogProvider } from '@/contexts/PostHogProvider';
import { ErrorView } from '@/views/ErrorView';
import { isSupabaseConfigMissing } from '@/lib/supabase';
const queryClient = new QueryClient();
function MissingConfig() {
return (
<div className="flex min-h-screen items-center justify-center bg-adam-bg-secondary-dark">
<div className="max-w-xl px-4 text-center text-red-500">
Missing API Keys. Please copy .env.local.template to .env.local and
restart.
</div>
</div>
);
}
function App({ error }: { error?: unknown }) {
if (isSupabaseConfigMissing) {
return <MissingConfig />;
}
return (
<QueryClientProvider client={queryClient}>
<AuthProvider>
<PostHogProvider>
<MeshFilesProvider>
<TooltipProvider delayDuration={0}>
<Toaster />
{error !== undefined ? <ErrorView error={error} /> : <Outlet />}
</TooltipProvider>
</MeshFilesProvider>
</PostHogProvider>
</AuthProvider>
</QueryClientProvider>
);
}
export default App;