import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
import '@/App.css';
import HomePage from './pages/HomePage';
import BlogListPage from './pages/BlogListPage';
import BlogDetailPage from './pages/BlogDetailPage';
import ShopPage from './pages/ShopPage';
import ProductDetailPage from './pages/ProductDetailPage';
import AdvertisePage from './pages/AdvertisePage';
import AdminLogin from './pages/admin/AdminLogin';
import AdminDashboard from './pages/admin/AdminDashboard';
import AdminBlogs from './pages/admin/AdminBlogs';
import AdminBlogEditor from './pages/admin/AdminBlogEditor';
import AdminServices from './pages/admin/AdminServices';
import AdminBrands from './pages/admin/AdminBrands';
import AdminAreas from './pages/admin/AdminAreas';
import AdminContact from './pages/admin/AdminContact';
import AdminAbout from './pages/admin/AdminAbout';
import AdminProducts from './pages/admin/AdminProducts';

function App() {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<HomePage />} />
        <Route path="/blog" element={<BlogListPage />} />
        <Route path="/blog/:id" element={<BlogDetailPage />} />
        <Route path="/shop" element={<ShopPage />} />
        <Route path="/product/:id" element={<ProductDetailPage />} />
        <Route path="/advertise" element={<AdvertisePage />} />
        <Route path="/admin" element={<Navigate to="/admin/login" replace />} />
        <Route path="/admin/login" element={<AdminLogin />} />
        <Route path="/admin/dashboard" element={<AdminDashboard />} />
        <Route path="/admin/blogs" element={<AdminBlogs />} />
        <Route path="/admin/blogs/new" element={<AdminBlogEditor />} />
        <Route path="/admin/blogs/:id" element={<AdminBlogEditor />} />
        <Route path="/admin/services" element={<AdminServices />} />
        <Route path="/admin/brands" element={<AdminBrands />} />
        <Route path="/admin/areas" element={<AdminAreas />} />
        <Route path="/admin/contact" element={<AdminContact />} />
        <Route path="/admin/about" element={<AdminAbout />} />
        <Route path="/admin/products" element={<AdminProducts />} />
      </Routes>
    </BrowserRouter>
  );
}

export default App;
