import Analysis from "./Analysis";
import "./App.css";
import Footer from "./Footer";
import Header from "./Header";
import Rankings from "./Rankings";
import { BrowserRouter, Routes, Route } from "react-router";
import { SessionProvider } from "./Session";

function App() {
  //const [data, setData] = useState({ nodes: [], links: [] } as SociogramData);
  //async function loadData() {
  //  await fetch(`${baseUrl}api/analysis/json`, { method: "GET" }).then(resp => resp.json() as unknown as SociogramData).then(json => { setData(json) })
  //}
  //useEffect(() => { loadData() }, [])
  //
  return (
    <BrowserRouter>
      <Header />
      <Routes>
        <Route index element={<Rankings />} />
        <Route path="/analysis" element={
          <SessionProvider>
            <Analysis />
          </SessionProvider>
        } />
      </Routes>
      <Footer />
    </BrowserRouter>
  );
}
export default App;
