This commit is contained in:
2025-10-23 15:30:48 -03:00
parent 235fb538e1
commit 8b5c940976
4 changed files with 77 additions and 16 deletions
+24 -15
View File
@@ -7,6 +7,7 @@ import { GenerationView } from "@/components/audio/GenerationView";
import { BotView } from "@/components/bots/BotView";
import { BotChat } from "@/components/bots/BotChat";
import { AgentView } from "@/components/agent/AgentView";
import { Navigate, Route, Routes } from "react-router-dom";
interface Bot {
id: string;
@@ -27,21 +28,29 @@ const Index = () => {
setActiveBotChat(null);
};
return (
<Layout activeTab={activeView} onTabChange={setActiveView}>
{activeView === "chat" && <ChatView />}
{activeView === "images" && <ImageView />}
{activeView === "transcription" && <TranscriptionView />}
{activeView === "generation" && <GenerationView />}
{activeView === "bots" && (
activeBotChat ? (
<BotChat bot={activeBotChat} onBack={handleBackFromBotChat} />
) : (
<BotView onStartChat={handleStartBotChat} />
)
)}
{activeView === "agent" && <AgentView />}
</Layout>
return (<Routes>
<Route path="" element={<Navigate to={`/404`} replace />} />
<Route path="codex">
<Route path="" element={
<Layout activeTab={activeView} onTabChange={setActiveView}>
{activeView === "chat" && <ChatView />}
{activeView === "images" && <ImageView />}
{activeView === "transcription" && <TranscriptionView />}
{activeView === "generation" && <GenerationView />}
{activeView === "bots" && (
activeBotChat ? (
<BotChat bot={activeBotChat} onBack={handleBackFromBotChat} />
) : (
<BotView onStartChat={handleStartBotChat} />
)
)}
{activeView === "agent" && <AgentView />}
</Layout>
} />
</Route>
</Routes>
);
};