import DashboardLayout from "./../layout/DashboardLayout.vue";
import NotFound from "./../views/NotFoundPage.vue";

// Admin pages
import Overview from "./../views/Overview.vue";
import UserProfile from "./../views/UserProfile.vue";
import TableList from "./../views/TableList.vue";
import Typography from "./../views/Typography.vue";
import Icons from "./../views/Icons.vue";
import Notifications from "./../views/Notifications.vue";
import Upgrade from "./../views/Upgrade.vue";

const routes = [
  {
    path: "/",
    component: DashboardLayout,
    redirect: "/admin/overview"
  },
  {
    path: "/admin",
    component: DashboardLayout,
    redirect: "/admin/overview",
    children: [
      {
        path: "overview",
        name: "Overview",
        component: Overview
      },
      {
        path: "user",
        name: "User",
        component: UserProfile
      },
      {
        path: "table-list",
        name: "Table List",
        component: TableList
      },
      {
        path: "typography",
        name: "Typography",
        component: Typography
      },
      {
        path: "icons",
        name: "Icons",
        component: Icons
      },
      {
        path: "notifications",
        name: "Notifications",
        component: Notifications
      },
      {
        path: "upgrade",
        name: "Upgrade to PRO",
        component: Upgrade
      }
    ]
  },
  { path: "*", component: NotFound }
]

/**
 * Asynchronously load view (Webpack Lazy loading compatible)
 * The specified component must be inside the Views folder
 * @param  {string} name  the filename (basename) of the view to load.
function view(name) {
   var res= require("../components/Dashboard/Views/" + name + ".vue");
   return res;
};**/

export default routes