2026-03-31 18:52:37 +08:00
|
|
|
import { Toaster } from "@/components/ui/sonner";
|
|
|
|
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
2026-04-09 17:00:44 +08:00
|
|
|
import { Route, Switch, Router } from "wouter";
|
2026-04-30 10:59:50 +08:00
|
|
|
import { useHashLocation } from "wouter/use-hash-location";
|
2026-03-31 18:52:37 +08:00
|
|
|
import ErrorBoundary from "./components/ErrorBoundary";
|
|
|
|
|
import { ThemeProvider } from "./contexts/ThemeContext";
|
|
|
|
|
import { DeviceProvider } from "./contexts/DeviceContext";
|
|
|
|
|
import Home from "./pages/Home";
|
|
|
|
|
import NotFound from "./pages/NotFound";
|
|
|
|
|
import Dashboard from "./pages/Dashboard";
|
|
|
|
|
import AudioPage from "./pages/AudioPage";
|
|
|
|
|
import EQPage from "./pages/EQPage";
|
|
|
|
|
import EffectsPage from "./pages/EffectsPage";
|
|
|
|
|
import BluetoothPage from "./pages/BluetoothPage";
|
|
|
|
|
import DspPage from "./pages/DspPage";
|
|
|
|
|
import DisplayPage from "./pages/DisplayPage";
|
|
|
|
|
import SystemPage from "./pages/SystemPage";
|
|
|
|
|
import IOPage from "./pages/IOPage";
|
|
|
|
|
import VUPage from "./pages/VUPage";
|
|
|
|
|
import SelectPage from "./pages/SelectPage";
|
2026-04-21 09:39:54 +08:00
|
|
|
import AIPage from "./pages/AIPage";
|
2026-04-29 17:56:03 +08:00
|
|
|
import CommunityPage from "./pages/CommunityPage";
|
2026-05-08 18:15:52 +08:00
|
|
|
import { AIDrawerProvider } from "./contexts/AIDrawerContext";
|
|
|
|
|
import DesktopAIShell from "./components/DesktopAIShell";
|
2026-05-25 16:30:40 +08:00
|
|
|
import { appShellColumnClass, appShellGutterClass } from "./lib/appShell";
|
2026-05-08 18:15:52 +08:00
|
|
|
|
|
|
|
|
function AIPageRoute() {
|
|
|
|
|
return <AIPage />;
|
|
|
|
|
}
|
2026-03-31 18:52:37 +08:00
|
|
|
|
2026-04-09 17:00:44 +08:00
|
|
|
function AppRouter() {
|
2026-03-31 18:52:37 +08:00
|
|
|
return (
|
|
|
|
|
<Switch>
|
|
|
|
|
<Route path="/" component={Home} />
|
|
|
|
|
<Route path="/dashboard" component={Dashboard} />
|
|
|
|
|
<Route path="/audio" component={AudioPage} />
|
|
|
|
|
<Route path="/eq" component={EQPage} />
|
|
|
|
|
<Route path="/effects" component={EffectsPage} />
|
|
|
|
|
<Route path="/bluetooth" component={BluetoothPage} />
|
|
|
|
|
<Route path="/dsp" component={DspPage} />
|
|
|
|
|
<Route path="/display" component={DisplayPage} />
|
|
|
|
|
<Route path="/system" component={SystemPage} />
|
|
|
|
|
<Route path="/io" component={IOPage} />
|
|
|
|
|
<Route path="/vu" component={VUPage} />
|
|
|
|
|
<Route path="/select" component={SelectPage} />
|
2026-05-08 18:15:52 +08:00
|
|
|
<Route path="/ai" component={AIPageRoute} />
|
2026-04-29 17:56:03 +08:00
|
|
|
<Route path="/community" component={CommunityPage} />
|
2026-03-31 18:52:37 +08:00
|
|
|
<Route path="/404" component={NotFound} />
|
|
|
|
|
<Route component={NotFound} />
|
|
|
|
|
</Switch>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function App() {
|
|
|
|
|
return (
|
|
|
|
|
<ErrorBoundary>
|
|
|
|
|
<ThemeProvider defaultTheme="dark">
|
|
|
|
|
<DeviceProvider>
|
|
|
|
|
<TooltipProvider>
|
|
|
|
|
<Toaster />
|
2026-04-30 10:59:50 +08:00
|
|
|
<Router hook={useHashLocation}>
|
2026-05-08 18:15:52 +08:00
|
|
|
<AIDrawerProvider>
|
2026-05-25 16:30:40 +08:00
|
|
|
<div
|
|
|
|
|
className={`min-h-dvh bg-[#0d1117] flex justify-center ${appShellGutterClass}`}
|
|
|
|
|
>
|
|
|
|
|
<div className={`min-h-dvh ${appShellColumnClass}`}>
|
2026-05-08 18:15:52 +08:00
|
|
|
<DesktopAIShell>
|
|
|
|
|
<AppRouter />
|
|
|
|
|
</DesktopAIShell>
|
|
|
|
|
</div>
|
2026-04-29 10:14:25 +08:00
|
|
|
</div>
|
2026-05-08 18:15:52 +08:00
|
|
|
</AIDrawerProvider>
|
2026-04-09 17:00:44 +08:00
|
|
|
</Router>
|
2026-03-31 18:52:37 +08:00
|
|
|
</TooltipProvider>
|
|
|
|
|
</DeviceProvider>
|
|
|
|
|
</ThemeProvider>
|
|
|
|
|
</ErrorBoundary>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default App;
|