import { Routes, Route, Navigate } from 'react-router-dom'
import MainLayout from './layouts/MainLayout'
import HomePage from './pages/HomePage'
import AgentChatPage from './pages/AgentChatPage'
import ChatPage from './pages/ChatPage'
import KnowledgePage from './pages/KnowledgePage'
import HistoryPage from './pages/HistoryPage'
import ReviewPage from './pages/ReviewPage'
import { RvwDashboard } from './pages/rvw'

function App() {
  return (
    <Routes>
      {/* RVW模块 - 独立布局 */}
      <Route path="/rvw" element={<RvwDashboard />} />
      
      {/* 主系统 */}
      <Route path="/" element={<MainLayout />}>
        <Route index element={<HomePage />} />
        <Route path="chat" element={<ChatPage />} />
        <Route path="review" element={<ReviewPage />} />
        <Route path="agent/:agentId" element={<AgentChatPage />} />
        <Route path="knowledge" element={<KnowledgePage />} />
        <Route path="history" element={<HistoryPage />} />
        <Route path="*" element={<Navigate to="/" replace />} />
      </Route>
    </Routes>
  )
}

export default App

