import versionRoutes from "./routes/version.route";

const routes = [
  {
    path: "/",

    component: () => import("layouts/MainLayout.vue"),

    meta: { requireAuth: true },

    children: [
      {
        path: "",
        redirect: { name: "DashboardPage" },
      },
    ],
  },

  {
    path: "/dashboard",

    component: () => import("layouts/MainLayout.vue"),

    children: [
      {
        path: "",
        name: "DashboardPage",

        component: () => import("pages/dashboard/DashboardPage.vue"),

        meta: {
          title: "Dashboard do Proprietário",
          requireAuth: true,

          breadcrumbs: [
            {
              name: "DashboardPage",
              title: "Dashboard do Proprietário",
            },
          ],
        },
      },
      {
        path: "despesas",
        name: "DashboardExpensesPage",

        component: () => import("pages/dashboard/DashboardExpensesPage.vue"),

        meta: {
          title: "Despesas do Proprietário",
          requireAuth: true,

          breadcrumbs: [
            {
              name: "DashboardPage",
              title: "Dashboard do Proprietário",
            },
            {
              name: "DashboardExpensesPage",
              title: "Despesas",
            },
          ],
        },
      },
    ],
  },

  {
    path: "/perfil",

    component: () => import("layouts/MainLayout.vue"),

    children: [
      {
        path: "",
        name: "ProfilePage",

        component: () => import("pages/profile/ProfilePage.vue"),

        meta: {
          requireAuth: true,
          title: "ui.navigation.profile",

          breadcrumbs: [
            {
              name: "DashboardPage",
              title: "ui.navigation.dashboard",
            },
            {
              name: "ProfilePage",
              title: "ui.navigation.profile",
            },
          ],
        },
      },
    ],
  },

  {
    path: "/login",

    component: () => import("layouts/LoginLayout.vue"),

    children: [
      {
        path: "",
        name: "LoginPage",

        component: () => import("pages/LoginPage.vue"),

        meta: {
          title: "Login do Proprietário",
        },
      },
    ],
  },

  {
    path: "/reset-password",

    component: () => import("layouts/LoginLayout.vue"),

    children: [
      {
        path: "",
        name: "ResetPasswordPage",

        component: () => import("pages/ResetPasswordPage.vue"),

        meta: {
          title: "Redefinir senha",
        },
      },
    ],
  },

  ...versionRoutes,

  // Always leave this as last one,
  // but you can also remove it
  {
    path: "/:catchAll(.*)*",

    component: () => import("pages/ErrorNotFound.vue"),
  },
];

export default routes;
