import { IModuleClient, ModuleClientParams } from "@erp/core/client";
import i18next from "i18next";
import enResources from "../common/locales/en.json";
import esResources from "../common/locales/es.json";
import { AuthRoutes } from "./auth-routes";

const MODULE_NAME = "auth";
const MODULE_VERSION = "1.0.0";

export const AuthModuleManifiest: IModuleClient = {
  name: MODULE_NAME,
  version: MODULE_VERSION,
  dependencies: ["core"],
  protected: false,
  layout: "auth",

  routes: (params: ModuleClientParams) => {
    i18next.addResourceBundle("en", MODULE_NAME, enResources, true, true);
    i18next.addResourceBundle("es", MODULE_NAME, esResources, true, true);
    return AuthRoutes(params);
  },
};

export default AuthModuleManifiest;
