import { type FC } from "react";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import { DbProvider } from "./context/db/provider";

import IndexPage from "./pages/Index";
import LoginPage from "./pages/Login";
import RegisterPage from "./pages/Register";

const router = createBrowserRouter([
  {
    path: "/",
    element: <IndexPage />,
  },
  {
    path: "/login",
    element: <LoginPage />,
  },
  {
    path: "/register",
    element: <RegisterPage />,
  },
]);

const App: FC = () => {
  return (
    <DbProvider>
      <RouterProvider router={router} />
    </DbProvider>
  );
};

export default App;
