import { Routes, Route } from "react-router-dom";
import { Layout } from "./components/Layout";
import { HomePage } from "./pages/HomePage";
import { PortfolioPage } from "./pages/PortfolioPage";
import { ProjectPage } from "./pages/ProjectPage";
import { ResumePage } from "./pages/ResumePage";
import { AboutPage } from "./pages/AboutPage";
import { AdminLayout } from "./pages/admin/AdminLayout";
import { AdminDashboard } from "./pages/admin/AdminDashboard";
import { AdminProjects } from "./pages/admin/AdminProjects";
import { AdminProjectEdit } from "./pages/admin/AdminProjectEdit";
import { AdminCategories } from "./pages/admin/AdminCategories";
import { AdminViews } from "./pages/admin/AdminViews";
import { AdminResume } from "./pages/admin/AdminResume";
import { AdminSettings } from "./pages/admin/AdminSettings";

export default function App() {
  return (
    <Routes>
      <Route element={<Layout />}>
        <Route index element={<HomePage />} />
        <Route path="portfolio" element={<PortfolioPage />} />
        <Route path="portfolio/:viewSlug" element={<PortfolioPage />} />
        <Route path="project/:slug" element={<ProjectPage />} />
        <Route path="resume" element={<ResumePage />} />
        <Route path="about" element={<AboutPage />} />
      </Route>
      <Route path="admin" element={<AdminLayout />}>
        <Route index element={<AdminDashboard />} />
        <Route path="projects" element={<AdminProjects />} />
        <Route path="projects/new" element={<AdminProjectEdit />} />
        <Route path="projects/:id" element={<AdminProjectEdit />} />
        <Route path="categories" element={<AdminCategories />} />
        <Route path="views" element={<AdminViews />} />
        <Route path="resume" element={<AdminResume />} />
        <Route path="settings" element={<AdminSettings />} />
      </Route>
    </Routes>
  );
}
