import React from "react";
import { Route, Routes } from "react-router-dom";
import Home from "../screens/home";
import About from "../screens/about";
import Error from "../screens/error";
import NavbarComponent from "../components/Navbar/Navbar";
import { CounterProvider } from "../Context/CounterContext";
import { PostProvider } from "../Context/PostContext";

const AppRputes = () => {
  return (
    <CounterProvider>
      <PostProvider>
        <Routes>
          <Route path="/" element={<NavbarComponent />}>
            <Route index element={<Home />} />
            <Route path="about" element={<About />} />
          </Route>
          <Route path="*" element={<Error />} />
        </Routes>
      </PostProvider>
    </CounterProvider>
  );
};

export default AppRputes;
