import Vue from "vue";
import VueRouter, { Route, RouteConfig } from "vue-router";

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: "/",
    redirect: `/approval-process`
  },
  {
    path: `/approval-process`,
    component: () => import("@/components/approval-process/ApprovalMain.vue"),
    children: [
      {
        path: `Lending`,
        components: {
          formUrl: () => import("@/components/approval-process/ApprovalSelectUser.vue")
          // busUrl: () => import("@/components/approval-process/ApprovalPath.vue")
        }
      },
      {
        path: `BaseLoanFlow`,
        components: {
          formUrl: () => import("@/components/approval-process/ApprovalSelectUser.vue")
          // busUrl: () => import("@/components/approval-process/ApprovalPath.vue")
        }
      },
      {
        path: `RepaymentPrincipalAndIncome`,
        components: {
          formUrl: () => import("@/components/approval-process/ApprovalSelectUser.vue")
          // busUrl: () => import("@/components/approval-process/ApprovalPath.vue")
        }
      }
    ]
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});
export default router;
