import React, { useEffect } from 'react'
import { Routes, Route } from 'react-router-dom'
import Layout from './components/Layout'
import HomePage from './pages/HomePage'
import EditorPage from './pages/EditorPage'
import AIVideoPage from './pages/AIVideoPage'
import SettingsPage from './pages/SettingsPage'
import TemplateManagePage from './pages/TemplateManagePage'
import TemplateDetailPage from './pages/TemplateDetailPage'
import ResourceCategoryPage from './pages/ResourceCategoryPage'
import ProjectManagePage from './pages/ProjectManagePage'
import ProjectDetailPage from './pages/ProjectDetailPage'
import ModelManagePage from './pages/ModelManagePage'
import AudioLibraryPage from './pages/AudioLibraryPage'
import MediaLibraryPage from './pages/MediaLibraryPage'
import KVTestPage from './pages/KVTestPage'
function App() {
  return (
    <Routes>
      {/* 项目详情页 - 无侧边栏布局 */}
      <Route path="/projects/:projectId" element={<ProjectDetailPage />} />

      {/* 其他页面 - 带侧边栏布局 */}
      <Route path="/*" element={
        <Layout>
          <Routes>
            <Route path="/" element={<HomePage />} />
            <Route path="/editor" element={<EditorPage />} />
            <Route path="/ai-video" element={<AIVideoPage />} />
            <Route path="/templates" element={<TemplateManagePage />} />
            <Route path="/templates/:templateId" element={<TemplateDetailPage />} />
            <Route path="/resource-categories" element={<ResourceCategoryPage />} />
            <Route path="/projects" element={<ProjectManagePage />} />
            <Route path="/models" element={<ModelManagePage />} />
            <Route path="/audio" element={<AudioLibraryPage />} />
            <Route path="/media" element={<MediaLibraryPage />} />
            <Route path="/kv-test" element={<KVTestPage />} />
            <Route path="/settings" element={<SettingsPage />} />
          </Routes>
        </Layout>
      } />
    </Routes>
  )
}

export default App
