import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";

import { AppShell } from "../shared/ui/app-shell";
import { OperationCreatePage } from "../pages/operation-create/page";
import { OperationDetailPage } from "../pages/operation-detail/page";
import { OperationListPage } from "../pages/operation-list/page";

export function AppRouter() {
  return (
    <BrowserRouter>
      <AppShell>
        <Routes>
          <Route path="/" element={<Navigate to="/operations" replace />} />
          <Route path="/operations" element={<OperationListPage />} />
          <Route path="/operations/new" element={<OperationCreatePage />} />
          <Route
            path="/operations/:operationId"
            element={<OperationDetailPage />}
          />
        </Routes>
      </AppShell>
    </BrowserRouter>
  );
}
