1import{a as v,s as t,H as f,a3 as o,aa as N,j as e,C as n,a2 as r,a6 as i,a4 as l,E as b}from"./index-DsK2l7ZO.js";import{r as c}from"./react-BRbr87Ug.js";import"./supabase-DlIdU0D8.js";function S(){const[a,m]=c.useState({newsletterSubscribers:0,pendingApplications:0,pendingIdeas:0,totalEvents:0}),[u,x]=c.useState(!0);v({title:"Admin Dashboard - Werbekreis Roding",description:"Verwaltungsübersicht für Werbekreis Roding Administratoren."}),c.useEffect(()=>{h()},[]);const h=async()=>{try{const[s,d,j,p]=await Promise.all([t.from("newsletter_subscriptions").select("id",{count:"exact"}).eq("active",!0),t.from("applications").select("id",{count:"exact"}).eq("status","pending"),t.from("ideas").select("id",{count:"exact"}).neq("status","approved"),t.from("events").select("id",{count:"exact"})]);m({newsletterSubscribers:s.count||0,pendingApplications:d.count||0,pendingIdeas:j.count||0,totalEvents:p.count||0})}catch(s){console.error("Error fetching stats:",s)}finally{x(!1)}},g=[{title:"Newsletter Abonnenten",value:a.newsletterSubscribers,icon:f,description:"Aktive Newsletter-Abonnenten"},{title:"Ausstehende Anträge",value:a.pendingApplications,icon:o,description:"Mitgliedsanträge zur Bearbeitung"},{title:"Ideen zur Prüfung",value:a.pendingIdeas,icon:N,description:"Eingereichte Ideen zur Genehmigung"}];return u?e.jsxs("div",{className:"space-y-6",children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Dashboard"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[1,2,3,4].map(s=>e.jsxs(n,{className:"animate-pulse",children:[e.jsx(r,{className:"pb-2",children:e.jsx("div",{className:"h-4 bg-muted rounded w-3/4"})}),e.jsxs(i,{children:[e.jsx("div",{className:"h-8 bg-muted rounded w-1/2 mb-2"}),e.jsx("div",{className:"h-3 bg-muted rounded w-full"})]})]},s))})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Dashboard"}),e.jsx("p",{className:"text-muted-foreground",children:"Ãbersicht über alle wichtigen Kennzahlen und ausstehenden Aufgaben"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:g.map(s=>{const d=s.icon;return e.jsxs(n,{children:[e.jsxs(r,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(l,{className:"text-sm font-medium",children:s.title}),e.jsx(d,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(i,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.value}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]})]},s.title)})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(n,{children:[e.jsx(r,{children:e.jsx(l,{children:"Schnellaktionen"})}),e.jsx(i,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("button",{className:"p-4 border rounded-lg hover:bg-muted transition-colors text-left",children:[e.jsx(o,{className:"h-6 w-6 mb-2 text-primary"}),e.jsx("div",{className:"font-medium",children:"Newsletter erstellen"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Neuen Newsletter verfassen"})]}),e.jsxs("button",{className:"p-4 border rounded-lg hover:bg-muted transition-colors text-left",children:[e.jsx(b,{className:"h-6 w-6 mb-2 text-primary"}),e.jsx("div",{className:"font-medium",children:"Event hinzufügen"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Neues Event erstellen"})]})]})})]}),e.jsxs(n,{children:[e.jsx(r,{children:e.jsx(l,{children:"Letzte Aktivitäten"})}),e.jsx(i,{children:e.jsxs("div",{className:"space-y-4 text-sm",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:"Neue Idee eingereicht"}),e.jsx("div",{className:"text-muted-foreground",children:"vor 2 Stunden"})]})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:"Newsletter-Anmeldung"}),e.jsx("div",{className:"text-muted-foreground",children:"vor 4 Stunden"})]})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"w-2 h-2 bg-yellow-500 rounded-full"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:"Mitgliedsantrag erhalten"}),e.jsx("div",{className:"text-muted-foreground",children:"vor 1 Tag"})]})]})]})})]})]})]})}export{S as default}; 2//# sourceMappingURL=Dashboard-BzoaPv_z.js.map
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.