rotas
This commit is contained in:
+24
-15
@@ -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>
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user