1import{a as f,r as i,C as j,i as N,j as e,g as d,Q as w}from"./index-DYqdqpF7.js";import{I as y}from"./image-CFZHWGFR.js";import{S as k}from"./star-BH2lwXtd.js";import{U as S}from"./users-C8B-AzGH.js";import{P as o}from"./plus-B8mSJmYp.js";import{E as $}from"./eye-B5Sl9-LJ.js";import{T as R}from"./trending-up-C5YU6eCu.js";function D(){const{language:t}=f(),[a,c]=i.useState(null),[m,u]=i.useState(!0);i.useEffect(()=>{async function s(){try{const r=w(),[l,g,p,b,n]=await Promise.all([fetch("/api/v1/admin/content/events?limit=1",{headers:r}),fetch("/api/v1/admin/content/media?limit=1",{headers:r}),fetch("/api/v1/admin/content/works?limit=1",{headers:r}),fetch("/api/v1/admin/content/reviews?limit=1",{headers:r}),fetch("/api/v1/admin/users/stats/summary",{headers:r})]),v=n.ok?await n.json():{total_users:0};c({events:(await l.json()).length||0,media:(await g.json()).length||0,works:(await p.json()).length||0,reviews:(await b.json()).length||0,users:v.total_users||0})}catch{}finally{u(!1)}}s()},[]);const h=[{icon:j,label:"Ãvénements",value:a?.events??"-",color:"bg-blue-500",path:"events"},{icon:y,label:"Médias",value:a?.media??"-",color:"bg-purple-500",path:"media"},{icon:N,label:"Åuvres",value:a?.works??"-",color:"bg-green-500",path:"works"},{icon:k,label:"Critiques",value:a?.reviews??"-",color:"bg-yellow-500",path:"reviews"},{icon:S,label:"Utilisateurs",value:a?.users??"-",color:"bg-pink-500",path:"users"}],x=[{icon:o,label:"Nouvel événement",path:"events/new",color:"bg-blue-500"},{icon:o,label:"Nouveau média",path:"media/new",color:"bg-purple-500"},{icon:o,label:"Nouvelle Åuvre",path:"works/new",color:"bg-green-500"},{icon:$,label:"Voir le site",path:`/${t}`,external:!0,color:"bg-gray-500"}];return e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Dashboard"}),e.jsx("p",{className:"text-muted-foreground",children:"Vue d'ensemble de l'administration"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 mb-8",children:h.map(s=>{const r=s.icon;return e.jsx(d,{to:`/${t}/admin/${s.path}`,className:"bg-card rounded-xl p-4 border border-border hover:border-primary/50 transition-colors",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg ${s.color} flex items-center justify-center`,children:e.jsx(r,{size:20,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:m?"...":s.value}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.label})]})]})},s.path)})}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4 text-foreground",children:"Actions rapides"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:x.map(s=>{const r=s.icon,l=s.external?s.path:`/${t}/admin/${s.path}`;return e.jsxs(d,{to:l,className:"flex items-center gap-3 p-4 bg-card rounded-xl border border-border hover:border-primary/50 transition-colors",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg ${s.color} flex items-center justify-center`,children:e.jsx(r,{size:16,className:"text-white"})}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.label})]},s.label)})})]}),e.jsx("div",{className:"bg-card rounded-xl p-6 border border-border",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/20 flex items-center justify-center",children:e.jsx(R,{size:24,className:"text-primary"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Bienvenue dans l'administration"}),e.jsx("p",{className:"text-muted-foreground",children:"Utilisez le menu de gauche pour naviguer entre les différentes sections. Toutes les modifications sont sauvegardées automatiquement."})]})]})})]})}export{D as AdminDashboard,D as default};
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.