2023-12-08 14:33:22 +01:00
|
|
|
import Providers from "@/context/providers";
|
|
|
|
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
|
|
|
import Wrapper from "@/components/Wrapper";
|
2024-02-27 22:39:05 +01:00
|
|
|
import Sidebar from "@/components/navigation/Sidebar";
|
2024-03-13 21:24:24 +01:00
|
|
|
|
2024-02-27 22:39:05 +01:00
|
|
|
import { isDesktop, isMobile } from "react-device-detect";
|
2024-02-22 03:27:02 +01:00
|
|
|
import Statusbar from "./components/Statusbar";
|
2024-02-27 22:39:05 +01:00
|
|
|
import Bottombar from "./components/navigation/Bottombar";
|
2024-03-13 21:24:24 +01:00
|
|
|
import { Suspense, lazy } from "react";
|
|
|
|
|
|
|
|
const Live = lazy(() => import("@/pages/Live"));
|
|
|
|
const Events = lazy(() => import("@/pages/Events"));
|
|
|
|
const Export = lazy(() => import("@/pages/Export"));
|
|
|
|
const Storage = lazy(() => import("@/pages/Storage"));
|
|
|
|
const SubmitPlus = lazy(() => import("@/pages/SubmitPlus"));
|
|
|
|
const ConfigEditor = lazy(() => import("@/pages/ConfigEditor"));
|
|
|
|
const System = lazy(() => import("@/pages/System"));
|
|
|
|
const Settings = lazy(() => import("@/pages/Settings"));
|
|
|
|
const UIPlayground = lazy(() => import("@/pages/UIPlayground"));
|
|
|
|
const Logs = lazy(() => import("@/pages/Logs"));
|
|
|
|
const NoMatch = lazy(() => import("@/pages/NoMatch"));
|
2023-12-08 14:33:22 +01:00
|
|
|
|
|
|
|
function App() {
|
|
|
|
return (
|
|
|
|
<Providers>
|
|
|
|
<BrowserRouter>
|
|
|
|
<Wrapper>
|
2024-02-28 04:40:57 +01:00
|
|
|
<div className="size-full pt-2 overflow-hidden">
|
2024-02-27 22:39:05 +01:00
|
|
|
{isDesktop && <Sidebar />}
|
2024-02-22 03:27:02 +01:00
|
|
|
{isDesktop && <Statusbar />}
|
2024-02-27 22:39:05 +01:00
|
|
|
{isMobile && <Bottombar />}
|
2023-12-21 01:37:35 +01:00
|
|
|
<div
|
|
|
|
id="pageRoot"
|
2024-03-02 01:43:02 +01:00
|
|
|
className={`absolute top-2 right-0 overflow-hidden ${isMobile ? "left-0 bottom-16" : "left-16 bottom-8"}`}
|
2023-12-21 01:37:35 +01:00
|
|
|
>
|
2024-03-13 21:24:24 +01:00
|
|
|
<Suspense>
|
|
|
|
<Routes>
|
|
|
|
<Route path="/" element={<Live />} />
|
|
|
|
<Route path="/events" element={<Events />} />
|
|
|
|
<Route path="/export" element={<Export />} />
|
|
|
|
<Route path="/storage" element={<Storage />} />
|
|
|
|
<Route path="/plus" element={<SubmitPlus />} />
|
|
|
|
<Route path="/system" element={<System />} />
|
|
|
|
<Route path="/settings" element={<Settings />} />
|
|
|
|
<Route path="/config" element={<ConfigEditor />} />
|
|
|
|
<Route path="/logs" element={<Logs />} />
|
|
|
|
<Route path="/playground" element={<UIPlayground />} />
|
|
|
|
<Route path="*" element={<NoMatch />} />
|
|
|
|
</Routes>
|
|
|
|
</Suspense>
|
2023-12-08 14:33:22 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Wrapper>
|
|
|
|
</BrowserRouter>
|
|
|
|
</Providers>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|