import { Navigate, Route, Routes } from 'react-router-dom'
import AppLayout from './layouts/AppLayout'
import CleanedNotesPage from './pages/CleanedNotesPage'
import DashboardPage from './pages/DashboardPage'
import ErrorsPage from './pages/ErrorsPage'
import MetricsPage from './pages/MetricsPage'
import RawNotesPage from './pages/RawNotesPage'
import RpaPage from './pages/RpaPage'
import ResourcesAccountsPage from './pages/ResourcesAccountsPage'
import ResourcesProxiesPage from './pages/ResourcesProxiesPage'
import ResourcesSessionsPage from './pages/ResourcesSessionsPage'
import TaskDetailPage from './pages/TaskDetailPage'
import TasksPage from './pages/TasksPage'
import AIGenerationPage from './pages/AIGenerationPage'
import ComplianceReviewPage from './pages/ComplianceReviewPage'
import LeadsPage from './pages/LeadsPage'

export default function App() {
  return (
    <Routes>
      <Route element={<AppLayout />}>
        <Route index element={<Navigate to="/dashboard" replace />} />
        <Route path="/dashboard" element={<DashboardPage />} />
        <Route path="/tasks" element={<TasksPage />} />
        <Route path="/tasks/:id" element={<TaskDetailPage />} />
        <Route path="/rpa" element={<RpaPage />} />
        <Route path="/errors" element={<ErrorsPage />} />
        <Route path="/metrics" element={<MetricsPage />} />
        <Route path="/resources" element={<Navigate to="/resources/accounts" replace />} />
        <Route path="/resources/accounts" element={<ResourcesAccountsPage />} />
        <Route path="/resources/sessions" element={<ResourcesSessionsPage />} />
        <Route path="/resources/proxies" element={<ResourcesProxiesPage />} />
        <Route path="/content/raw-notes" element={<RawNotesPage />} />
        <Route path="/content/cleaned-notes" element={<CleanedNotesPage />} />
        <Route path="/ai/generation" element={<AIGenerationPage />} />
        <Route path="/compliance/review" element={<ComplianceReviewPage />} />
        <Route path="/leads" element={<LeadsPage />} />
        <Route path="*" element={<Navigate to="/dashboard" replace />} />
      </Route>
    </Routes>
  )
}
