import React from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import Layout from "./components/Layout";
import Dashboard from "./pages/Dashboard";
import Repository from "./pages/Repository";
import Scheduler from "./pages/Scheduler";
import PostEditor from "./pages/PostEditor";
import Integrations from "./pages/Integrations";
import { createPageUrl } from "./utils";

function App() {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Layout currentPageName="Dashboard"><Dashboard /></Layout>} />
        <Route path={createPageUrl("Repository")} element={<Layout currentPageName="Repository"><Repository /></Layout>} />
        <Route path={createPageUrl("Scheduler")} element={<Layout currentPageName="Scheduler"><Scheduler /></Layout>} />
        <Route path={createPageUrl("PostEditor")} element={<Layout currentPageName="PostEditor"><PostEditor /></Layout>} />
        <Route path={createPageUrl("Integrations")} element={<Layout currentPageName="Integrations"><Integrations /></Layout>} />
      </Routes>
    </Router>
  );
}

export default App;
