import { Navigate, Route, Routes } from "react-router-dom"
import { AppShell } from "@/layouts/app-shell"
import DashboardPage from "@/pages/admin/dashboard"
import UsersPage from "@/pages/admin/users"
import UserDetailsPage from "@/pages/admin/users/[id]"
import UserActivityPage from "@/pages/admin/users/[id]/activity"
import LogsPage from "@/pages/admin/logs"
import ErrorLogsPage from "@/pages/admin/logs/errors"
import AccessLogsPage from "@/pages/admin/logs/access"
import LogDetailsPage from "@/pages/admin/logs/[id]"
import SettingsPage from "@/pages/admin/settings"
import MaintenancePage from "@/pages/admin/maintenance"
import AnnouncementsPage from "@/pages/admin/announcements"
import AuditPage from "@/pages/admin/audit"
import SecurityPage from "@/pages/admin/security"
import FailedLoginsPage from "@/pages/admin/security/failed-logins"
import SuspiciousActivityPage from "@/pages/admin/security/suspicious"
import ApiKeysPage from "@/pages/admin/security/api-keys"
import RateLimitsPage from "@/pages/admin/security/rate-limits"
import SessionsPage from "@/pages/admin/security/sessions"
import AnalyticsPage from "@/pages/admin/analytics"
import AnalyticsOverviewPage from "@/pages/admin/analytics/overview"
import AnalyticsUsersPage from "@/pages/admin/analytics/users"
import AnalyticsRevenuePage from "@/pages/admin/analytics/revenue"
import AnalyticsStoragePage from "@/pages/admin/analytics/storage"
import AnalyticsApiPage from "@/pages/admin/analytics/api"
import HealthPage from "@/pages/admin/health"

function App() {
  return (
    <Routes>
      <Route element={<AppShell />}>
        <Route index element={<Navigate to="/admin/dashboard" replace />} />
        <Route path="admin/dashboard" element={<DashboardPage />} />
        <Route path="admin/users" element={<UsersPage />} />
        <Route path="admin/users/:id" element={<UserDetailsPage />} />
        <Route path="admin/users/:id/activity" element={<UserActivityPage />} />
        <Route path="admin/logs" element={<LogsPage />} />
        <Route path="admin/logs/errors" element={<ErrorLogsPage />} />
        <Route path="admin/logs/access" element={<AccessLogsPage />} />
        <Route path="admin/logs/:id" element={<LogDetailsPage />} />
        <Route path="admin/settings" element={<SettingsPage />} />
        <Route path="admin/maintenance" element={<MaintenancePage />} />
        <Route path="admin/announcements" element={<AnnouncementsPage />} />
        <Route path="admin/audit" element={<AuditPage />} />
        <Route path="admin/security" element={<SecurityPage />} />
        <Route path="admin/security/failed-logins" element={<FailedLoginsPage />} />
        <Route path="admin/security/suspicious" element={<SuspiciousActivityPage />} />
        <Route path="admin/security/api-keys" element={<ApiKeysPage />} />
        <Route path="admin/security/rate-limits" element={<RateLimitsPage />} />
        <Route path="admin/security/sessions" element={<SessionsPage />} />
        <Route path="admin/analytics" element={<AnalyticsPage />} />
        <Route path="admin/analytics/overview" element={<AnalyticsOverviewPage />} />
        <Route path="admin/analytics/users" element={<AnalyticsUsersPage />} />
        <Route path="admin/analytics/revenue" element={<AnalyticsRevenuePage />} />
        <Route path="admin/analytics/storage" element={<AnalyticsStoragePage />} />
        <Route path="admin/analytics/api" element={<AnalyticsApiPage />} />
        <Route path="admin/health" element={<HealthPage />} />
      </Route>
      <Route path="*" element={<Navigate to="/admin/dashboard" replace />} />
    </Routes>
  )
}

export default App
