import type { AdminLanguage } from "@/i18n/languages";
import type { AdminI18nNamespace } from "@/i18n/namespaces";

export type AdminLanguageBundle = Record<AdminI18nNamespace, Record<string, unknown>>;

const loaders: Record<AdminLanguage, () => Promise<{ default: AdminLanguageBundle }>> = {
  zh: () => import("@/i18n/bundles/zh"),
  en: () => import("@/i18n/bundles/en"),
  ne: () => import("@/i18n/bundles/ne"),
};

export async function loadAdminLanguageBundle(language: AdminLanguage): Promise<AdminLanguageBundle> {
  const mod = await loaders[language]();
  return mod.default;
}
