import { jsx as e, jsxs as n } from "react/jsx-runtime";
import { useTranslation as d } from "react-i18next";
import * as m from "lucide-react";
import { Box as s, ArrowRight as u } from "lucide-react";
import { Link as v } from "react-router-dom";
import { e as h, f as p, B as x } from "./index-Dh9kUeDn.js";
function b(r) {
  if (!r) return s;
  const o = m;
  if (o[r]) return o[r];
  const a = r.toLowerCase(), c = Object.keys(o).find((t) => t.toLowerCase() === a);
  return c ? o[c] : s;
}
function g({ module: r, buildUrl: o }) {
  const { t: a } = d("admin"), c = b(r.icon), t = r.sections?.length ?? 0;
  return /* @__PURE__ */ e("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__ */ n(
    v,
    {
      to: r.route ? o(r.route) : "#",
      className: "block p-6",
      children: [
        /* @__PURE__ */ e("div", { className: "flex items-start justify-between mb-4", children: /* @__PURE__ */ e("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: /* @__PURE__ */ e(c, { className: "w-7 h-7 text-[var(--color-accent-500)]" }) }) }),
        /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-[var(--text-primary)] mb-2", children: r.label }),
        t > 0 && /* @__PURE__ */ n("p", { className: "text-sm text-[var(--text-secondary)] mb-4", children: [
          t,
          " ",
          t === 1 ? a("modules.sectionCount_one", "section") : a("modules.sectionCount_other", "sections")
        ] }),
        /* @__PURE__ */ n("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: [
          a("modules.open", "Ouvrir"),
          /* @__PURE__ */ e(u, { className: "w-4 h-4" })
        ] })
      ]
    }
  ) });
}
function j() {
  const { t: r } = d("admin"), { getCurrentApplication: o, isLoading: a } = h(), c = p(), t = o(), i = t?.modules ?? [];
  return a ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e("div", { className: "w-8 h-8 border-2 border-[var(--color-accent-500)] border-t-transparent rounded-full animate-spin" }) }) : /* @__PURE__ */ n("div", { className: "space-y-8", children: [
    /* @__PURE__ */ e(
      x,
      {
        items: [
          { label: t?.label ?? r("modules.title", "Modules") }
        ]
      }
    ),
    /* @__PURE__ */ n("div", { children: [
      /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-[var(--text-primary)]", children: t?.label ?? r("modules.title", "Modules") }),
      /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)] mt-1", children: r("modules.subtitle", "Sélectionnez un module pour commencer") })
    ] }),
    /* @__PURE__ */ e("section", { children: i.length > 0 ? /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4", children: i.map((l) => /* @__PURE__ */ e(
      g,
      {
        module: l,
        buildUrl: c
      },
      l.id
    )) }) : /* @__PURE__ */ n("div", { className: "text-center py-12 bg-[var(--bg-card)] rounded-2xl border border-[var(--border-color)]", children: [
      /* @__PURE__ */ e(s, { className: "w-12 h-12 text-[var(--text-tertiary)] mx-auto mb-4" }),
      /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)]", children: r("modules.noModules", "Aucun module disponible") })
    ] }) })
  ] });
}
export {
  j as ApplicationsGridPage
};
//# sourceMappingURL=ApplicationsGridPage-C9H_-C5W.js.map
