import React from "react";
import {BrowserRouter as Router, Navigate, Route, Routes} from "react-router-dom";
import MainNavigation from "./components/Navigations/MainNavigation";
import SideNavigation from "./components/Navigations/SideNavigation";
import MarkdownContent from "./components/Markdowns/MarkdownContent";
import MarkdownEditor from "./components/Markdowns/MarkdownEditor";
import "./App.css";
import Callback from "./components/KeycloakCallbacks/Callback";
import Footer from "./components/Footer";
import PopupCallback from "./components/KeycloakCallbacks/PopupCallback";
import SilentCallback from "./components/KeycloakCallbacks/SilentCallback";
import {useHomeMarkdown} from "./utils/markdown-queries";

const App = () => {

    return (
        <Router>
            <div className="app-container">
                <MainNavigation />
                <div className="content-container">
                    <SideNavigation />
                    <main className="main-content">
                        <Routes>
                            <Route
                                path="/"
                                element={<Navigate to = "/markdown/1"/>}
                            />
                            <Route path="/testx" element={<h2>test2</h2>}/>
                            <Route path="/markdown/:id" element={<MarkdownContent />} />
                            <Route path="/callback" element={<Callback />} />
                            <Route path="/test" element={<h1>TEST</h1>}></Route>
                            <Route path="/markdown/create" element={<MarkdownEditor />} />
                            <Route path="/markdown/edit/:id" element={<MarkdownEditor />} />
                            <Route path="/popup_callback" element={<PopupCallback />} />
                            <Route path="silent_callback" element={<SilentCallback />} />
                        </Routes>
                    </main>
                </div>
            </div>
            <Footer />
        </Router>
    );
};

export default App;
