mirror of
https://github.com/aiclientproxy/proxycast.git
synced 2026-09-21 12:44:14 +08:00
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { useState } from "react";
|
|
import { Sidebar } from "./components/Sidebar";
|
|
import { Dashboard } from "./components/Dashboard";
|
|
import { Providers } from "./components/Providers";
|
|
import { Models } from "./components/Models";
|
|
import { Settings } from "./components/Settings";
|
|
import { Logs } from "./components/Logs";
|
|
|
|
type Page = "dashboard" | "providers" | "models" | "settings" | "logs";
|
|
|
|
function App() {
|
|
const [currentPage, setCurrentPage] = useState<Page>("dashboard");
|
|
|
|
const renderPage = () => {
|
|
switch (currentPage) {
|
|
case "dashboard":
|
|
return <Dashboard />;
|
|
case "providers":
|
|
return <Providers />;
|
|
case "models":
|
|
return <Models />;
|
|
case "settings":
|
|
return <Settings />;
|
|
case "logs":
|
|
return <Logs />;
|
|
default:
|
|
return <Dashboard />;
|
|
}
|
|
};
|
|
|
|
return (
|
|
<div className="flex h-screen bg-background">
|
|
<Sidebar currentPage={currentPage} onNavigate={setCurrentPage} />
|
|
<main className="flex-1 overflow-auto p-6">{renderPage()}</main>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default App;
|