import React from 'react';
import { Routes, Route, Navigate } from 'react-router-dom';
import IitLayout from './IitLayout';

const DashboardPage = React.lazy(() => import('./pages/DashboardPage'));
const AiStreamPage = React.lazy(() => import('./pages/AiStreamPage'));
const EQueryPage = React.lazy(() => import('./pages/EQueryPage'));
const ReportsPage = React.lazy(() => import('./pages/ReportsPage'));
const AiChatPage = React.lazy(() => import('./pages/AiChatPage'));

const IitModule: React.FC = () => {
  return (
    <Routes>
      {/* CRA 质控平台 — 终端用户日常使用界面 */}
      <Route element={<IitLayout />}>
        <Route index element={<Navigate to="dashboard" replace />} />
        <Route path="dashboard" element={<DashboardPage />} />
        <Route path="stream" element={<AiStreamPage />} />
        <Route path="equery" element={<EQueryPage />} />
        <Route path="reports" element={<ReportsPage />} />
        <Route path="chat" element={<AiChatPage />} />
      </Route>
    </Routes>
  );
};

export default IitModule;
