import { ThemeListener } from './components/layout/ThemeListener';
/**
 * @license
 * SPDX-License-Identifier: Apache-2.0
 */

import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import { HelmetProvider } from 'react-helmet-async';
import Layout from './components/Layout';
import Home from './pages/Home';
import BlogPost from './pages/BlogPost';
import CategoryPage from './pages/CategoryPage';
import About from './pages/About';
import Methodology from './pages/Methodology';
import Privacy from './pages/Privacy';
import Terms from './pages/Terms';
import Contact from './pages/Contact';
import Archive from './pages/Archive';
import NotFound from './pages/NotFound';
import Bookmarks from './pages/Bookmarks';

import { LanguageProvider } from './contexts/LanguageContext';
import { BookmarksProvider } from './contexts/BookmarksContext';

export default function App() {
  return (
    <HelmetProvider>
      <LanguageProvider>
        <BookmarksProvider>
          <Router>
      <ThemeListener />
            <Layout>
              <Routes>
                <Route path="/" element={<Home />} />
                <Route path="/artigo/:slug" element={<BlogPost />} />
                <Route path="/categoria/:categorySlug" element={<CategoryPage />} />
                <Route path="/sobre" element={<About />} />
                <Route path="/metodologia" element={<Methodology />} />
                <Route path="/privacidade" element={<Privacy />} />
                <Route path="/termos" element={<Terms />} />
                <Route path="/contato" element={<Contact />} />
                <Route path="/arquivo" element={<Archive />} />
                <Route path="/leituras-salvas" element={<Bookmarks />} />
                <Route path="*" element={<NotFound />} />
              </Routes>
            </Layout>
          </Router>
        </BookmarksProvider>
      </LanguageProvider>
    </HelmetProvider>
  );
}
