import React from 'react'
import { BrowserRouter, Routes, Route } from 'react-router-dom'
import { AppQueryProvider } from './lib/queries'
import { ErrorBoundary } from './components/ErrorBoundary'
import { NavBar } from './components/NavBar'
import { LTTPage } from './pages/LTTPage'
import { RAGDatabasePage } from './pages/RAGDatabasePage'

export default function App(): JSX.Element {
  return (
    <BrowserRouter>
      <AppQueryProvider>
        <ErrorBoundary>
          <div className="h-screen flex flex-col">
            <NavBar />
            <div className="flex-1 overflow-auto">
              <Routes>
                <Route path="/" element={<LTTPage />} />
                <Route path="/rag-database" element={<RAGDatabasePage />} />
              </Routes>
            </div>
          </div>
        </ErrorBoundary>
      </AppQueryProvider>
    </BrowserRouter>
  )
}
