PageSourceSearch

https://beewant.com/assets/skms-organigramme-DQChlpgx.js

js beewant.com collected 2026-10-08 05:02:27 UTC 5,418 bytes, 1 lines download raw bytes

1import{j as e,a9 as _,t as C,Z as L,a5 as E,k as R}from"./ui-vendor-DmoOtcNH.js";import{r as u}from"./react-vendor-s1LR0eZg.js";import{l as $,m as M}from"./skms.queries-CMRkgcjR.js";import{u as y}from"./index-DfS-bhEm.js";import"./skms.api-Dy4PrdWS.js";function N(s,a=""){const r=[];for(const l of s)r.push({node:l,path:a}),l.children?.length&&r.push(...N(l.children,a?`${a} › ${l.libelle}`:l.libelle));return r}function B(){const{t:s,i18n:a}=y(),{data:r,isLoading:l}=$(),{data:c,isLoading:i,isError:d}=M(),[b,w]=u.useState(new Set),[h,k]=u.useState(""),o=c?.tree??[],p=u.useMemo(()=>N(o),[o]),x=h.trim().toLowerCase(),g=u.useMemo(()=>x.length<2?[]:p.filter(({node:t})=>[t.libelle,t.sigle,t.encadrant].some(n=>(n||"").toLowerCase().includes(x))),[p,x]),O=t=>w(n=>{const m=new Set(n);return m.has(t)?m.delete(t):m.add(t),m}),j=r?.derniere_sync?new Date(r.derniere_sync).toLocaleString(a.language):null,S=[{label:s("skmsOrga.structures"),value:r?.total_structures},{label:s("skmsOrga.managers"),value:r?.nb_encadrants},{label:s("skmsOrga.agents"),value:r?.nb_agents_total}];return e.jsx("div",{className:"h-full overflow-y-auto",children:e.jsxs("div",{className:"mx-auto w-full max-w-5xl px-6 py-8",children:[e.jsxs("div",{className:"mb-6 flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"rounded-lg bg-primary/10 p-2 text-primary",children:e.jsx(_,{className:"h-5 w-5","aria-hidden":!0})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("skmsOrga.title")}),e.jsx("p",{className:"text-sm text-secondary-text",children:s("skmsOrga.subtitle")})]})]}),j&&e.jsx("span",{className:"text-xs text-secondary-text",children:s("skmsOrga.lastSync",{date:j})})]}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:S.map(t=>e.jsxs("div",{className:"rounded-xl border bg-card p-4",children:[e.jsx("div",{className:"text-xs text-secondary-text",children:t.label}),l?e.jsx("div",{className:"mt-2 h-7 w-16 animate-pulse rounded bg-muted"}):e.jsx("div",{className:"mt-1 text-2xl font-bold tabular-nums text-primary",children:(t.value??0).toLocaleString()})]},t.label))}),e.jsxs("div",{className:"relative mt-6",children:[e.jsx(C,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-secondary-text","aria-hidden":!0}),e.jsx("input",{type:"text",value:h,onChange:t=>k(t.target.value),placeholder:s("skmsOrga.searchPlaceholder"),className:"w-full rounded-lg border bg-card py-2.5 pl-9 pr-4 text-sm outline-none transition-colors focus:border-primary"})]}),e.jsx("div",{className:"mt-6",children:d?e.jsx("div",{className:"rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:s("skmsOrga.loadError")}):i?e.jsx("div",{className:"space-y-2",children:Array.from({length:8}).map((t,n)=>e.jsx("div",{className:"h-11 animate-pulse rounded-lg bg-muted"},n))}):x.length>=2?g.length===0?e.jsx("p",{className:"py-10 text-center text-sm text-secondary-text",children:s("skmsOrga.noResults")}):e.jsx("div",{className:"divide-y overflow-hidden rounded-xl border",children:g.slice(0,100).map(({node:t,path:n})=>e.jsxs("div",{className:"px-4 py-2.5",children:[e.jsx(f,{node:t}),n&&e.jsx("div",{className:"ml-6 mt-0.5 text-xs text-secondary-text",children:n})]},t.code))}):o.length===0?e.jsx("p",{className:"py-10 text-center text-sm text-secondary-text",children:s("skmsOrga.empty")}):e.jsx("div",{className:"space-y-2",children:o.map(t=>e.jsx(v,{node:t,depth:0,expanded:b,onToggle:O},t.code))})})]})})}function f({node:s}){const{t:a}=y();return e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[s.sigle&&e.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-secondary-text",children:s.sigle}),e.jsx("span",{className:"text-sm font-medium",children:s.libelle}),s.encadrant&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-secondary-text",children:["· ",s.encadrant,s.encadrant_email&&e.jsx("a",{href:`mailto:${s.encadrant_email}`,className:"cursor-pointer text-primary hover:underline",title:s.encadrant_email,children:e.jsx(L,{className:"h-3.5 w-3.5"})})]}),typeof s.nb_agents=="number"&&s.nb_agents>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-secondary-text",children:[e.jsx(E,{className:"h-3.5 w-3.5"}),a("skmsOrga.agentCount",{count:s.nb_agents})]})]})}function v({node:s,depth:a,expanded:r,onToggle:l}){const c=!!s.children?.length,i=r.has(s.code);return e.jsxs("div",{className:a===0?"rounded-xl border bg-card p-2":"",children:[e.jsxs("div",{className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 transition-colors hover:bg-muted/50",style:{marginLeft:a>0?a*16:0},children:[c?e.jsx("button",{type:"button",onClick:()=>l(s.code),className:"cursor-pointer text-secondary-text hover:text-foreground","aria-label":i?"collapse":"expand",children:e.jsx(R,{className:`h-4 w-4 transition-transform ${i?"rotate-90":""}`})}):e.jsx("span",{className:"inline-block w-4"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(f,{node:s})}),c&&e.jsxs("span",{className:"shrink-0 text-xs text-secondary-text",children:["(",s.children?.length,")"]})]}),c&&i&&e.jsx("div",{className:"mt-1 space-y-1",children:s.children?.map(d=>e.jsx(v,{node:d,depth:a+1,expanded:r,onToggle:l},d.code))})]})}export{B as SkmsOrganigrammePage};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.