/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/

import { ThemeProvider } from "@/components/theme-provider";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import { Dashboard } from "@/components/dashboard/dashboard";
import { HomePage } from "@/components/home-page/homePage";
import PBFTPage from "@/components/home-page/PBFTFullView";
import AuthorsPage from "./components/Authors/AuthorPage";
import { Toaster } from "./components/ui/toaster";
import { CpuPage, FlamegraphPage } from "@/pages/CpuPage";
import { MemoryPage } from "@/pages/MemoryPage";
import { ExplorerPage } from "@/pages/ExplorerPage";
import { ResViewPage } from "@/pages/ResViewPage";
import { ModeProvider } from "@/contexts/ModeContext";
import { Loading } from "@/components/ui/loading";

function App() {
  return (
    <ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
      <ModeProvider>
        <Toaster />
        <BrowserRouter>
          <Routes>
            <Route path="/" element={<HomePage />} />
            <Route path="/dashboard" element={<Dashboard />} />
            <Route path="/pbft" element={<PBFTPage />} />
            <Route path="/authors" element={<AuthorsPage />} />
            <Route path="/cpu" element={<CpuPage />} />
            <Route path="/memory" element={<MemoryPage />} />
            {/* <Route path="/explorer" element={<ExplorerPage />} /> */}
            <Route path="/resview" element={<ResViewPage />} />
            <Route path="/flamegraph" element={<FlamegraphPage />} />
          </Routes>
        </BrowserRouter>
      </ModeProvider>
    </ThemeProvider>
  );
}

export default App;
