import {
  Route,
  createBrowserRouter,
  createRoutesFromElements,
  RouterProvider,
} from "react-router-dom";
import HomePage from "./pages/HomePage";
import NavBar from "./components/NavBar/NavBar";
import LearnPage from "./pages/LearnPage";
import BuildPage from "./pages/BuildPage";
import Community from "./pages/Community";
import Contact from "./pages/Contact";

const router = createBrowserRouter(
  createRoutesFromElements(
    <Route path="/" element={<NavBar />}>
      <Route index element={<HomePage />} />
      <Route path="LearnPage" element={<LearnPage />} />
      <Route path="BuildPage" element={<BuildPage />} />
      <Route path="community" element={<Community />} />
      <Route path="Contact" element={<Contact />} />
    </Route>
  )
);

function App() {
  return (
    <>
      <RouterProvider router={router} />
    </>
  );
}

export default App;
