import { BrowserRouter, Routes, Route } from 'react-router-dom';
import Hero from './components/Hero';
import Experience from './components/Experience';
import Skills from './components/Skills';
import Education from './components/Education';
import Projects from './components/Projects';
import Contact from './components/Contact';
import AdminLayout from './admin/AdminLayout';
import AdminPersonal from './admin/AdminPersonal';
import AdminExperience from './admin/AdminExperience';
import AdminSkills from './admin/AdminSkills';
import AdminEducation from './admin/AdminEducation';
import AdminProjects from './admin/AdminProjects';
import { CVProvider } from './admin/hooks/CVContext';
import { AuthProvider } from './admin/hooks/AuthContext';

function CV() {
  return (
    <div className="min-h-screen">
      <Hero />
      <Experience />
      <Skills />
      <Education />
      <Projects />
      <Contact />
    </div>
  );
}

function App() {
  return (
    <AuthProvider>
      <CVProvider>
        <BrowserRouter>
          <Routes>
            <Route path="/" element={<CV />} />
            <Route path="/admin" element={<AdminLayout />}>
              <Route index element={<AdminPersonal />} />
              <Route path="experience" element={<AdminExperience />} />
              <Route path="skills" element={<AdminSkills />} />
              <Route path="education" element={<AdminEducation />} />
              <Route path="projects" element={<AdminProjects />} />
            </Route>
          </Routes>
        </BrowserRouter>
      </CVProvider>
    </AuthProvider>
  );
}

export default App;
