38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
|
import { ThemeProvider } from "@/components/theme-provider";
|
||
|
import LayoutMain from "@/pages/Layout";
|
||
|
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
|
||
|
import Boot from "@/pages/Boot";
|
||
|
import { Setting } from "./pages/Setting";
|
||
|
import { useEffect } from "react";
|
||
|
import { Models } from "./pages/Models";
|
||
|
import { Tools } from "./pages/Tools";
|
||
|
import { Datasource } from "./pages/Datasource";
|
||
|
|
||
|
function App() {
|
||
|
const theme = document.querySelector("html")!.getAttribute("theme") as
|
||
|
| "dark"
|
||
|
| "light";
|
||
|
|
||
|
useEffect(() => {
|
||
|
window.ipcRenderer.send("ipc-loaded");
|
||
|
}, []);
|
||
|
|
||
|
return (
|
||
|
<ThemeProvider defaultTheme={theme} storageKey="vite-ui-theme">
|
||
|
<Router>
|
||
|
<Routes>
|
||
|
<Route path="/" element={<LayoutMain />}>
|
||
|
<Route index element={<Boot />} />
|
||
|
<Route path="models" element={<Models />} />
|
||
|
<Route path="datasource" element={<Datasource />} />
|
||
|
<Route path="tools" element={<Tools />} />
|
||
|
<Route path="setting" element={<Setting />} />
|
||
|
</Route>
|
||
|
</Routes>
|
||
|
</Router>
|
||
|
</ThemeProvider>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default App;
|