import { Routes, Route, Navigate } from 'react-router-dom'
import { AdminLayout } from './layouts/AdminLayout'
import { LoginPage } from './pages/login/LoginPage'
import { DashboardPage } from './pages/dashboard/DashboardPage'
import { OrdersPage } from './pages/orders/OrdersPage'
import { UsersPage } from './pages/users/UsersPage'
import { DistributionPage } from './pages/distribution/DistributionPage'
import { WithdrawalsPage } from './pages/withdrawals/WithdrawalsPage'
import { ContentPage } from './pages/content/ContentPage'
import { ReferralSettingsPage } from './pages/referral-settings/ReferralSettingsPage'
import { SettingsPage } from './pages/settings/SettingsPage'
import { PaymentPage } from './pages/payment/PaymentPage'
import { SitePage } from './pages/site/SitePage'
import { QRCodesPage } from './pages/qrcodes/QRCodesPage'
import { MatchPage } from './pages/match/MatchPage'
import { MatchRecordsPage } from './pages/match-records/MatchRecordsPage'
import { VipRolesPage } from './pages/vip-roles/VipRolesPage'
import { MentorsPage } from './pages/mentors/MentorsPage'
import { MentorConsultationsPage } from './pages/mentor-consultations/MentorConsultationsPage'
import { FindPartnerPage } from './pages/find-partner/FindPartnerPage'
import { ApiDocPage } from './pages/api-doc/ApiDocPage'
import { NotFoundPage } from './pages/not-found/NotFoundPage'

function App() {
  return (
    <Routes>
      <Route path="/login" element={<LoginPage />} />
      <Route path="/" element={<AdminLayout />}>
        <Route index element={<Navigate to="/dashboard" replace />} />
        <Route path="dashboard" element={<DashboardPage />} />
        <Route path="orders" element={<OrdersPage />} />
        <Route path="users" element={<UsersPage />} />
        <Route path="distribution" element={<DistributionPage />} />
        <Route path="withdrawals" element={<WithdrawalsPage />} />
        <Route path="content" element={<ContentPage />} />
        <Route path="referral-settings" element={<ReferralSettingsPage />} />
        <Route path="author-settings" element={<Navigate to="/settings?tab=author" replace />} />
        <Route path="admin-users" element={<Navigate to="/settings?tab=admin" replace />} />
        <Route path="vip-roles" element={<VipRolesPage />} />
        <Route path="mentors" element={<MentorsPage />} />
        <Route path="mentor-consultations" element={<MentorConsultationsPage />} />
        <Route path="settings" element={<SettingsPage />} />
        <Route path="payment" element={<PaymentPage />} />
        <Route path="site" element={<SitePage />} />
        <Route path="qrcodes" element={<QRCodesPage />} />
        <Route path="find-partner" element={<FindPartnerPage />} />
        <Route path="match" element={<MatchPage />} />
        <Route path="match-records" element={<MatchRecordsPage />} />
        <Route path="api-doc" element={<ApiDocPage />} />
      </Route>
      <Route path="*" element={<NotFoundPage />} />
    </Routes>
  )
}

export default App
