import { jsx as r, jsxs as i } from "react/jsx-runtime";
import { useTranslation as l } from "react-i18next";
import * as m from "lucide-react";
import { Box as d, Layers as u, ArrowRight as b } from "lucide-react";
import { Link as h } from "react-router-dom";
import { u as p, b as v, P as g } from "./index-CeEMms9z.js";
function x(e, n) {
  let t = d;
  if (e) {
    const o = m;
    if (o[e]) t = o[e];
    else {
      const s = e.toLowerCase(), a = Object.keys(o).find((c) => c.toLowerCase() === s);
      a && (t = o[a]);
    }
  }
  return /* @__PURE__ */ r(t, { className: n });
}
function f({ module: e, buildUrl: n }) {
  const { t } = l("admin"), o = e.sections?.length ?? 0;
  return /* @__PURE__ */ r("div", { className: "group relative bg-[var(--bg-card)] rounded-2xl border border-[var(--border-color)] overflow-hidden hover:border-[var(--color-accent-500)]/50 transition-all duration-300 hover:shadow-lg hover:shadow-[var(--color-accent-500)]/10", children: /* @__PURE__ */ i(
    h,
    {
      to: e.route ? n(e.route) : "#",
      className: "block p-6",
      children: [
        /* @__PURE__ */ r("div", { className: "flex items-start justify-between mb-4", children: /* @__PURE__ */ r("div", { className: "w-14 h-14 rounded-xl bg-gradient-to-br from-[var(--color-accent-500)]/20 to-[var(--color-accent-600)]/20 flex items-center justify-center group-hover:from-[var(--color-accent-500)]/30 group-hover:to-[var(--color-accent-600)]/30 transition-all", children: x(e.icon, "w-7 h-7 text-[var(--color-accent-500)]") }) }),
        /* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-[var(--text-primary)] mb-2", children: e.label }),
        o > 0 && /* @__PURE__ */ i("p", { className: "text-sm text-[var(--text-secondary)] mb-4", children: [
          o,
          " ",
          o === 1 ? t("modules.sectionCount_one", "section") : t("modules.sectionCount_other", "sections")
        ] }),
        /* @__PURE__ */ i("div", { className: "flex items-center gap-2 text-[var(--color-accent-500)] text-sm font-medium opacity-0 group-hover:opacity-100 transition-opacity", children: [
          t("modules.open", "Ouvrir"),
          /* @__PURE__ */ r(b, { className: "w-4 h-4" })
        ] })
      ]
    }
  ) });
}
function L() {
  const { t: e } = l("admin"), { getCurrentApplication: n, isLoading: t } = p(), o = v(), s = n(), a = s?.modules ?? [];
  return t ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ r("div", { className: "w-8 h-8 border-2 border-[var(--color-accent-500)] border-t-transparent rounded-full animate-spin" }) }) : /* @__PURE__ */ r(
    g,
    {
      title: s?.label ?? e("modules.title", "Modules"),
      subtitle: e("modules.subtitle", "Sélectionnez un module pour commencer"),
      icon: /* @__PURE__ */ r(u, { className: "w-6 h-6" }),
      breadcrumbs: [
        { label: s?.label ?? e("modules.title", "Modules") }
      ],
      children: /* @__PURE__ */ r("section", { children: a.length > 0 ? /* @__PURE__ */ r("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4", children: a.map((c) => /* @__PURE__ */ r(
        f,
        {
          module: c,
          buildUrl: o
        },
        c.id
      )) }) : /* @__PURE__ */ i("div", { className: "text-center py-12 bg-[var(--bg-card)] rounded-2xl border border-[var(--border-color)]", children: [
        /* @__PURE__ */ r(d, { className: "w-12 h-12 text-[var(--text-tertiary)] mx-auto mb-4" }),
        /* @__PURE__ */ r("p", { className: "text-[var(--text-secondary)]", children: e("modules.noModules", "Aucun module disponible") })
      ] }) })
    }
  );
}
export {
  L as ApplicationsGridPage
};
//# sourceMappingURL=ApplicationsGridPage-BLDS_JoW.js.map
