import React from 'react';
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
import Layout from '../components/Layout';
import DashboardPage from '../pages/DashboardPage';
import ProductPage from '../pages/ProductPage';
import OrdersPage from '../pages/OrdersPage';
import AdPage from '../pages/AdPage';
import InventoryPage from '../pages/InventoryPage';
import B2BPage from '../pages/B2BPage';
import FinancePage from '../pages/FinancePage';
import CompliancePage from '../pages/CompliancePage';
import SettingsPage from '../pages/SettingsPage';
import IndependentSiteList from '../pages/IndependentSite/List';

const AppRoutes: React.FC = () => {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Navigate to="/dashboard" />} />
        <Route path="/" element={<Layout />}>
          <Route path="dashboard" element={<DashboardPage />} />
          <Route path="product" element={<ProductPage />} />
          <Route path="orders" element={<OrdersPage />} />
          <Route path="ad" element={<AdPage />} />
          <Route path="inventory" element={<InventoryPage />} />
          <Route path="b2b" element={<B2BPage />} />
          <Route path="finance" element={<FinancePage />} />
          <Route path="compliance" element={<CompliancePage />} />
          <Route path="settings" element={<SettingsPage />} />
          <Route path="independent-site" element={<IndependentSiteList />} />
        </Route>
      </Routes>
    </Router>
  );
};

export default AppRoutes;