import { jsxs as l, jsx as e } from "react/jsx-runtime";
import { useMemo as v } from "react";
import { Link as b } from "react-router-dom";
import { useTranslation as N } from "react-i18next";
import { ArrowLeft as u, Target as g, Lightbulb as y, Users as m, XCircle as o, CheckCircle as d, Zap as h, Gauge as w, Shield as j, DollarSign as A, TrendingUp as q, Clock as C } from "lucide-react";
function K({ data: r, backPath: a = "/docs", backLabel: x = "nav.backToDocs", i18nNamespace: p = "docs" }) {
  const { t } = N([p, "docs"]), i = v(() => {
    let s = 0;
    return {
      valeur: ++s,
      useCases: r.useCases?.length ? ++s : 0,
      benefits: r.benefits?.length ? ++s : 0,
      beforeAfter: r.beforeAfter ? ++s : 0,
      features: r.features?.length ? ++s : 0,
      steps: r.steps?.length ? ++s : 0,
      faq: r.faq?.length ? ++s : 0,
      reference: r.businessRules || r.permissions || r.apiEndpoints ? ++s : 0
    };
  }, [r]), f = (s) => {
    switch (s) {
      case "time":
        return /* @__PURE__ */ e(C, { className: "w-8 h-8 text-blue-600" });
      case "quality":
        return /* @__PURE__ */ e(q, { className: "w-8 h-8 text-green-600" });
      case "roi":
        return /* @__PURE__ */ e(A, { className: "w-8 h-8 text-amber-600" });
      case "users":
        return /* @__PURE__ */ e(m, { className: "w-8 h-8 text-purple-600" });
      case "automation":
        return /* @__PURE__ */ e(h, { className: "w-8 h-8 text-orange-600" });
      case "security":
        return /* @__PURE__ */ e(j, { className: "w-8 h-8 text-red-600" });
      default:
        return /* @__PURE__ */ e(w, { className: "w-8 h-8 text-gray-600" });
    }
  };
  return /* @__PURE__ */ l("div", { className: "space-y-8", children: [
    a && /* @__PURE__ */ l(
      b,
      {
        to: a,
        className: "inline-flex items-center gap-2 text-[var(--text-secondary)] hover:text-[var(--color-primary-600)] transition-colors",
        children: [
          /* @__PURE__ */ e(u, { className: "w-4 h-4" }),
          t(x)
        ]
      }
    ),
    /* @__PURE__ */ l("div", { children: [
      /* @__PURE__ */ e("h1", { className: "text-3xl font-bold mb-4", children: r.overview.title ? t(r.overview.title) : t(r.overview.objective) }),
      r.overview.title && /* @__PURE__ */ e("p", { className: "text-lg text-[var(--text-secondary)] mb-2", children: t(r.overview.objective) }),
      /* @__PURE__ */ e("p", { className: "text-xl text-[var(--color-primary-600)] font-medium mb-2", children: t(r.overview.solution) }),
      r.overview.stats && /* @__PURE__ */ l("div", { className: "flex gap-4 text-sm text-[var(--text-secondary)]", children: [
        r.overview.stats.useCases && /* @__PURE__ */ l("span", { children: [
          r.overview.stats.useCases,
          " cas d'usage"
        ] }),
        r.overview.stats.businessRules && /* @__PURE__ */ l("span", { children: [
          r.overview.stats.businessRules,
          " règles métier"
        ] }),
        r.overview.stats.permissions && /* @__PURE__ */ l("span", { children: [
          r.overview.stats.permissions,
          " permissions"
        ] }),
        r.overview.stats.endpoints && /* @__PURE__ */ l("span", { children: [
          r.overview.stats.endpoints,
          " endpoints API"
        ] })
      ] })
    ] }),
    /* @__PURE__ */ l("section", { id: "valeur", className: "scroll-mt-4", children: [
      /* @__PURE__ */ l("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-primary-600)] text-white flex items-center justify-center text-sm", children: i.valeur }),
        "Pourquoi ce module ?"
      ] }),
      /* @__PURE__ */ l("div", { className: "card p-6", children: [
        /* @__PURE__ */ l("div", { className: "mb-6", children: [
          /* @__PURE__ */ l("h3", { className: "font-semibold mb-3 flex items-center gap-2", children: [
            /* @__PURE__ */ e(g, { className: "w-5 h-5 text-red-500" }),
            "Le problème que nous résolvons"
          ] }),
          /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)]", children: t(r.overview.problem) })
        ] }),
        /* @__PURE__ */ l("div", { className: "p-4 rounded-lg bg-green-500/10 border border-green-500/20", children: [
          /* @__PURE__ */ l("h3", { className: "font-semibold mb-2 flex items-center gap-2 text-green-700", children: [
            /* @__PURE__ */ e(y, { className: "w-5 h-5" }),
            "Notre solution"
          ] }),
          /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)]", children: t(r.overview.solution) })
        ] })
      ] })
    ] }),
    r.useCases && r.useCases.length > 0 && /* @__PURE__ */ l("section", { id: "cas-usage", className: "scroll-mt-4", children: [
      /* @__PURE__ */ l("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-primary-600)] text-white flex items-center justify-center text-sm", children: i.useCases }),
        "Cas d'usage"
      ] }),
      /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: r.useCases.map((s) => /* @__PURE__ */ l("div", { className: "card p-6", children: [
        /* @__PURE__ */ l("div", { className: "flex items-center gap-3 mb-4", children: [
          /* @__PURE__ */ e("div", { className: "w-12 h-12 rounded-full bg-blue-500/10 flex items-center justify-center", children: /* @__PURE__ */ e(m, { className: "w-6 h-6 text-blue-600" }) }),
          /* @__PURE__ */ l("div", { children: [
            /* @__PURE__ */ e("div", { className: "font-semibold", children: t(s.name) }),
            /* @__PURE__ */ e("div", { className: "text-sm text-[var(--text-secondary)]", children: s.actor })
          ] })
        ] }),
        /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: t(s.description) }),
        s.priority && /* @__PURE__ */ l("span", { className: "inline-block mt-3 px-2 py-1 text-xs rounded bg-[var(--bg-secondary)] text-[var(--text-secondary)]", children: [
          "Priorité: ",
          s.priority
        ] })
      ] }, s.id)) })
    ] }),
    r.benefits && r.benefits.length > 0 && /* @__PURE__ */ l("section", { id: "benefices", className: "scroll-mt-4", children: [
      /* @__PURE__ */ l("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-primary-600)] text-white flex items-center justify-center text-sm", children: i.benefits }),
        "Bénéfices concrets"
      ] }),
      /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: r.benefits.map((s, c) => /* @__PURE__ */ l("div", { className: "card p-6 text-center", children: [
        /* @__PURE__ */ e("div", { className: "w-16 h-16 mx-auto mb-4 rounded-full bg-blue-500/10 flex items-center justify-center", children: f(s.icon) }),
        /* @__PURE__ */ e("div", { className: "text-3xl font-bold text-[var(--color-primary-600)] mb-2", children: s.value }),
        /* @__PURE__ */ e("div", { className: "font-semibold mb-1", children: t(s.titleKey) }),
        /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: t(s.descriptionKey) })
      ] }, c)) })
    ] }),
    r.beforeAfter && /* @__PURE__ */ l("section", { id: "avant-apres", className: "scroll-mt-4", children: [
      /* @__PURE__ */ l("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-primary-600)] text-white flex items-center justify-center text-sm", children: i.beforeAfter }),
        "Avant / Après"
      ] }),
      /* @__PURE__ */ e("div", { className: "card p-6", children: /* @__PURE__ */ l("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
        /* @__PURE__ */ l("div", { className: "p-4 rounded-lg bg-red-500/5 border border-red-500/20", children: [
          /* @__PURE__ */ l("h3", { className: "font-semibold mb-4 flex items-center gap-2 text-red-600", children: [
            /* @__PURE__ */ e(o, { className: "w-5 h-5" }),
            "Avant"
          ] }),
          /* @__PURE__ */ e("ul", { className: "space-y-2", children: r.beforeAfter.beforeItems.map((s, c) => /* @__PURE__ */ l("li", { className: "flex items-start gap-2 text-sm", children: [
            /* @__PURE__ */ e(o, { className: "w-4 h-4 text-red-500 mt-0.5 flex-shrink-0" }),
            /* @__PURE__ */ e("span", { children: s })
          ] }, c)) })
        ] }),
        /* @__PURE__ */ l("div", { className: "p-4 rounded-lg bg-green-500/5 border border-green-500/20", children: [
          /* @__PURE__ */ l("h3", { className: "font-semibold mb-4 flex items-center gap-2 text-green-600", children: [
            /* @__PURE__ */ e(d, { className: "w-5 h-5" }),
            "Après"
          ] }),
          /* @__PURE__ */ e("ul", { className: "space-y-2", children: r.beforeAfter.afterItems.map((s, c) => /* @__PURE__ */ l("li", { className: "flex items-start gap-2 text-sm", children: [
            /* @__PURE__ */ e(d, { className: "w-4 h-4 text-green-500 mt-0.5 flex-shrink-0" }),
            /* @__PURE__ */ e("span", { children: s })
          ] }, c)) })
        ] })
      ] }) })
    ] }),
    r.features && r.features.length > 0 && /* @__PURE__ */ l("section", { id: "fonctionnalites", className: "scroll-mt-4", children: [
      /* @__PURE__ */ l("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-primary-600)] text-white flex items-center justify-center text-sm", children: i.features }),
        "Ce que vous pouvez faire"
      ] }),
      /* @__PURE__ */ e("div", { className: "space-y-4", children: r.features.map((s) => /* @__PURE__ */ e("div", { className: "card p-6", children: /* @__PURE__ */ l("div", { className: "flex items-start gap-4", children: [
        /* @__PURE__ */ e("div", { className: "w-12 h-12 rounded-lg bg-[var(--color-primary-600)]/10 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ e(h, { className: "w-6 h-6 text-[var(--color-primary-600)]" }) }),
        /* @__PURE__ */ l("div", { className: "flex-1", children: [
          /* @__PURE__ */ e("h3", { className: "font-semibold mb-2", children: t(s.title) }),
          /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)] mb-3", children: t(s.description) }),
          s.example && /* @__PURE__ */ l("div", { className: "p-3 rounded-lg bg-[var(--bg-secondary)] text-sm", children: [
            /* @__PURE__ */ e("span", { className: "font-medium text-[var(--color-primary-600)]", children: "Exemple: " }),
            t(s.example)
          ] })
        ] })
      ] }) }, s.id)) })
    ] }),
    r.steps && r.steps.length > 0 && /* @__PURE__ */ l("section", { id: "guide", className: "scroll-mt-4", children: [
      /* @__PURE__ */ l("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-primary-600)] text-white flex items-center justify-center text-sm", children: i.steps }),
        "Comment démarrer"
      ] }),
      /* @__PURE__ */ e("div", { className: "card p-6", children: /* @__PURE__ */ e("div", { className: "space-y-6", children: r.steps.map((s, c) => /* @__PURE__ */ l("div", { className: "flex gap-4", children: [
        /* @__PURE__ */ l("div", { className: "flex flex-col items-center", children: [
          /* @__PURE__ */ e("div", { className: "w-10 h-10 rounded-full bg-[var(--color-primary-600)] text-white flex items-center justify-center font-bold", children: s.number }),
          c < r.steps.length - 1 && /* @__PURE__ */ e("div", { className: "w-0.5 h-full bg-[var(--border-color)] mt-2" })
        ] }),
        /* @__PURE__ */ l("div", { className: "flex-1 pb-6", children: [
          /* @__PURE__ */ e("h4", { className: "font-semibold mb-2", children: s.title }),
          /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)] mb-3", children: s.description }),
          s.screenshotKey && r.screenshots?.[s.screenshotKey] && /* @__PURE__ */ e(
            "img",
            {
              src: r.screenshots[s.screenshotKey],
              alt: s.title,
              className: "rounded-lg border border-[var(--border-color)]",
              onError: (n) => {
                n.target.style.display = "none";
              }
            }
          )
        ] })
      ] }, s.number)) }) })
    ] }),
    r.faq && r.faq.length > 0 && /* @__PURE__ */ l("section", { id: "faq", className: "scroll-mt-4", children: [
      /* @__PURE__ */ l("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-primary-600)] text-white flex items-center justify-center text-sm", children: i.faq }),
        "Questions fréquentes"
      ] }),
      /* @__PURE__ */ e("div", { className: "space-y-4", children: r.faq.map((s, c) => /* @__PURE__ */ l("div", { className: "card p-4", children: [
        /* @__PURE__ */ e("h3", { className: "font-medium mb-2", children: t(s.questionKey) }),
        /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: t(s.answerKey) })
      ] }, c)) })
    ] }),
    (r.businessRules || r.permissions || r.apiEndpoints) && /* @__PURE__ */ e("section", { id: "reference", className: "scroll-mt-4", children: /* @__PURE__ */ l("details", { className: "card", children: [
      /* @__PURE__ */ l("summary", { className: "p-4 cursor-pointer hover:bg-[var(--bg-secondary)] rounded-lg font-semibold flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-gray-500/10 text-gray-600 flex items-center justify-center text-sm", children: i.reference }),
        "Référence technique (administrateurs)"
      ] }),
      /* @__PURE__ */ l("div", { className: "p-4 pt-0 space-y-6", children: [
        r.businessRules && r.businessRules.length > 0 && /* @__PURE__ */ l("div", { children: [
          /* @__PURE__ */ e("h3", { className: "font-semibold mb-3", children: "Règles métier" }),
          /* @__PURE__ */ e("div", { className: "space-y-2", children: r.businessRules.map((s) => /* @__PURE__ */ l("div", { className: "p-3 rounded-lg bg-[var(--bg-secondary)]", children: [
            /* @__PURE__ */ l("div", { className: "flex items-center gap-2 mb-1", children: [
              /* @__PURE__ */ e("span", { className: "text-xs font-mono text-[var(--color-primary-600)]", children: s.id }),
              /* @__PURE__ */ e("span", { className: "text-xs px-2 py-0.5 rounded bg-[var(--color-primary-600)]/10", children: s.category })
            ] }),
            /* @__PURE__ */ e("div", { className: "font-medium text-sm", children: s.name }),
            /* @__PURE__ */ e("p", { className: "text-xs text-[var(--text-secondary)] mt-1", children: t(s.statement) })
          ] }, s.id)) })
        ] }),
        r.permissions && r.permissions.length > 0 && /* @__PURE__ */ l("div", { children: [
          /* @__PURE__ */ e("h3", { className: "font-semibold mb-3", children: "Permissions" }),
          /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ l("table", { className: "w-full text-sm", children: [
            /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "border-b border-[var(--border-color)]", children: [
              /* @__PURE__ */ e("th", { className: "text-left py-2 px-3", children: "Permission" }),
              /* @__PURE__ */ e("th", { className: "text-left py-2 px-3", children: "Description" }),
              /* @__PURE__ */ e("th", { className: "text-left py-2 px-3", children: "Rôles" })
            ] }) }),
            /* @__PURE__ */ e("tbody", { children: r.permissions.map((s, c) => /* @__PURE__ */ l("tr", { className: "border-b border-[var(--border-color)]", children: [
              /* @__PURE__ */ e("td", { className: "py-2 px-3 font-mono text-xs", children: s.path }),
              /* @__PURE__ */ e("td", { className: "py-2 px-3", children: s.description }),
              /* @__PURE__ */ e("td", { className: "py-2 px-3", children: /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: s.roles.map((n) => /* @__PURE__ */ e(
                "span",
                {
                  className: "px-2 py-0.5 rounded bg-[var(--color-primary-600)]/10 text-xs",
                  children: n
                },
                n
              )) }) })
            ] }, c)) })
          ] }) })
        ] }),
        r.apiEndpoints && r.apiEndpoints.length > 0 && /* @__PURE__ */ l("div", { children: [
          /* @__PURE__ */ e("h3", { className: "font-semibold mb-3", children: "Points de terminaison API" }),
          /* @__PURE__ */ e("div", { className: "space-y-2", children: r.apiEndpoints.map((s, c) => /* @__PURE__ */ l("div", { className: "p-3 rounded-lg bg-[var(--bg-secondary)]", children: [
            /* @__PURE__ */ l("div", { className: "flex items-center gap-2 mb-1", children: [
              /* @__PURE__ */ e(
                "span",
                {
                  className: `text-xs font-bold px-2 py-0.5 rounded ${s.method === "GET" ? "bg-blue-500/10 text-blue-600" : s.method === "POST" ? "bg-green-500/10 text-green-600" : s.method === "PUT" || s.method === "PATCH" ? "bg-orange-500/10 text-orange-600" : "bg-red-500/10 text-red-600"}`,
                  children: s.method
                }
              ),
              /* @__PURE__ */ e("code", { className: "text-xs", children: s.path })
            ] }),
            /* @__PURE__ */ l("div", { className: "text-xs text-[var(--text-secondary)] mt-1", children: [
              "Handler: ",
              s.handler,
              " | Permission: ",
              s.permission
            ] })
          ] }, c)) })
        ] })
      ] })
    ] }) })
  ] });
}
export {
  K as D
};
//# sourceMappingURL=DocRenderer-CcEn1iaa.js.map
