import { useMemo } from "react";
import {
  createBrowserRouter,
  Navigate,
  RouterProvider,
} from "react-router-dom";

import LearnViewPage from "@/pages/learn/view/page";

const appRouter = createBrowserRouter([
  {
    children: [
      {
        index: true,
        element: <Navigate to="/learn/123" />,
      },
      {
        path: "learn/:id",
        Component: LearnViewPage,
      },
    ],
  },
]);

// const authRouter = createBrowserRouter([]);

const Router = () => {
  const router = useMemo(() => {
    return appRouter;
  }, []);

  return <RouterProvider router={router} />;
};

export default Router;
