import { Navigate, Route, Routes } from 'react-router-dom'
import AdminLayout from './layouts/AdminLayout'
import UserLayout from './layouts/UserLayout'
import AdminMinePage from './pages/admin/mine/MinePage'
import ToolboxPage from './pages/admin/toolbox/ToolboxPage'
import WorkspacePage from './pages/admin/workspace/WorkspacePage'
import AIBudgetPage from './pages/user/ai/AIBudgetPage'
import AIPage from './pages/user/ai/AIPage'
import BudgetDetailPage from './pages/user/ai/BudgetDetailPage'
import ExplorePage from './pages/user/explore/ExplorePage'
import BusBookingPage from './pages/user/group/BusBookingPage'
import GroupBuyPage from './pages/user/group/GroupBuyPage'
import GroupStorePage from './pages/user/group/GroupStorePage'
import PackageDetailPage from './pages/user/group/PackageDetailPage'
import BalconyPage from './pages/user/home/BalconyPage'
import DesignerPage from './pages/user/home/DesignerPage'
import HomePage from './pages/user/home/HomePage'
import HomePage2 from './pages/user/home/HomePage2'
import DataAssetsPage from './pages/user/mine/DataAssetsPage'
import DesignSchemesPage from './pages/user/mine/DesignSchemesPage'
import MinePage from './pages/user/mine/MinePage'
import PartnerCenterPage from './pages/user/mine/PartnerCenterPage'
import SettingsPage from './pages/user/mine/SettingsPage'
import ProgressPage from './pages/user/progress/ProgressPage'

function App() {
  return (
    <Routes>
      <Route path="/" element={<Navigate to="/user/home" replace />} />

      <Route path="/user" element={<UserLayout />}>
        <Route path="home" element={<HomePage />} />
        <Route path="home2" element={<HomePage2 />} />
        <Route path="designer" element={<DesignerPage />} />
        <Route path="balcony" element={<BalconyPage />} />
        <Route path="ai" element={<AIPage />} />
        <Route path="ai/budget" element={<AIBudgetPage />} />
        <Route path="ai/budget/:category" element={<BudgetDetailPage />} />
        <Route path="explore" element={<ExplorePage />} />
        <Route path="group" element={<GroupBuyPage />} />
        <Route path="group/store" element={<GroupStorePage />} />
        <Route path="group/package/:id" element={<PackageDetailPage />} />
        <Route path="group/bus-booking" element={<BusBookingPage />} />
        <Route path="progress" element={<ProgressPage />} />
        <Route path="mine" element={<MinePage />} />
        <Route path="mine/data" element={<DataAssetsPage />} />
        <Route path="mine/designs" element={<DesignSchemesPage />} />
        <Route path="mine/partner" element={<PartnerCenterPage />} />
        <Route path="mine/settings" element={<SettingsPage />} />
      </Route>

      <Route path="/admin" element={<AdminLayout />}>
        <Route path="workspace" element={<WorkspacePage />} />
        <Route path="mine" element={<AdminMinePage />} />
        <Route path="toolbox" element={<ToolboxPage />} />
      </Route>
    </Routes>
  )
}

export default App
