AK-21/Graphite-Industrial-Intelligence
0
1import { useState } from 'react';2import { QueryClient, QueryClientProvider } from '@tanstack/react-query';3import { httpBatchLink } from '@trpc/client';4import { trpc } from './trpc';5import DashboardLayout from './components/DashboardLayout';6import { Route, Switch } from 'wouter';7 8// Pages9import AssetRegistry from './pages/AssetRegistry';10import DocumentIngestion from './pages/DocumentIngestion';11import KnowledgeQA from './pages/KnowledgeQA';12import KnowledgeGraph from './pages/KnowledgeGraph';13import AnomalyFeed from './pages/AnomalyFeed';14import HomeDashboard from './pages/HomeDashboard';15 16function App() {17 const [queryClient] = useState(() => new QueryClient());18 const [trpcClient] = useState(() =>19 trpc.createClient({20 links: [21 httpBatchLink({22 url: import.meta.env.PROD ? '/trpc' : 'http://localhost:7860/trpc',23 }),24 ],25 }),26 );27 28 return (29 <trpc.Provider client={trpcClient} queryClient={queryClient}>30 <QueryClientProvider client={queryClient}>31 <Switch>32 <Route path="/" component={HomeDashboard} />33 <Route>34 <DashboardLayout>35 <Switch>36 <Route path="/assets" component={AssetRegistry} />37 <Route path="/documents" component={DocumentIngestion} />38 <Route path="/qa" component={KnowledgeQA} />39 <Route path="/graph" component={KnowledgeGraph} />40 <Route path="/alerts" component={AnomalyFeed} />41 <Route>42 <div className="flex items-center justify-center h-full text-gray-500">43 Page under construction.44 </div>45 </Route>46 </Switch>47 </DashboardLayout>48 </Route>49 </Switch>50 </QueryClientProvider>51 </trpc.Provider>52 );53}54 55export default App;56 