import { useState } from "react"; import { Layout } from "@/components/Layout"; import { ChatView } from "@/components/chat/ChatView"; import { ImageView } from "@/components/images/ImageView"; import { TranscriptionView } from "@/components/audio/TranscriptionView"; 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"; import React from "react"; import { GlobalFunctions } from "@/GlobalFunctions"; interface Bot { id: string; name: string; prompt: string; model: string; } const Index = () => { const [activeView, setActiveView] = useState<"chat" | "images" | "transcription" | "generation" | "bots" | "agent">("chat"); const [activeBotChat, setActiveBotChat] = useState(null); const handleStartBotChat = (bot: Bot) => { setActiveBotChat(bot); }; const handleBackFromBotChat = () => { setActiveBotChat(null); }; React.useEffect(() => { if(!GlobalFunctions.isUsuarioLogado())window.location.replace(import.meta.env.VITE_BASE_URL_HGTX_CORE); },[]); return ( } /> {activeView === "chat" && } {activeView === "images" && } {activeView === "transcription" && } {activeView === "generation" && } {activeView === "bots" && ( activeBotChat ? ( ) : ( ) )} {activeView === "agent" && } } /> } /> ); }; export default Index;