import { PageConstant } from "~/constant/pageConstant";
import { layout } from "~/router/constant";

const modules = import.meta.glob<{ default: any }>("./modules/**/*.ts", { eager: true });

const routeModuleList: any = [];

Object.keys(modules).forEach((key) => {
  const mod = modules[key].default || {};
  const modList = Array.isArray(mod) ? [...mod] : [mod];
  routeModuleList.push(...modList);
});

export default {
  path: "/layout",
  name: "Layout",
  // component: layout,
  meta: { title: "Layout" },
  redirect: PageConstant.BASE_HOME,
  children: [...routeModuleList],
};
