1import{r as a,ah as e}from"./vendor-CKvsIKfo.js";import{L as l}from"./router-DszvRzEA.js";import{x as k,y as C,z as S}from"./index-CaASt3Q1.js";import{o as b,p,P as A,r as W,s as u,t as P,u as R,v as w,x as r,N as g,y as D,w as o,ac as T,W as q,aH as n,a3 as F,a4 as J}from"./icons-BjyY1iAy.js";import"./helmet-WS_6bwOh.js";function B(){const[t,j]=a.useState(null),[c,f]=a.useState([]),[d,x]=a.useState(!1),m=()=>{j(k()),f(C(15))};a.useEffect(()=>{m()},[]);const N=async()=>{confirm("Reset all CMS data to defaults? This cannot be undone.")&&(x(!0),await new Promise(s=>setTimeout(s,500)),S(),m(),x(!1))};if(!t)return null;const v=[{label:"Blog Posts",value:t.blogPosts,icon:b,color:"#3b82f6",link:"/admin/blog-posts"},{label:"Case Studies",value:t.caseStudies,icon:p,color:"#8b5cf6",link:"/admin/case-studies"},{label:"AI Products",value:t.products,icon:A,color:"#06b6d4",link:"/admin/products"},{label:"Industries",value:t.industries,icon:W,color:"#f59e0b",link:"/admin/industries"},{label:"Testimonials",value:t.testimonials,icon:u,color:"#10b981",link:"/admin/testimonials"},{label:"Awards",value:t.awards,icon:P,color:"#ec4899",link:"/admin/awards"},{label:"Partners",value:t.partners,icon:R,color:"#6366f1",link:"/admin/partners"},{label:"FAQs",value:t.faqs,icon:w,color:"#14b8a6",link:"/admin/faqs"}],y=[{label:"Contact Forms",value:t.contactSubmissions,icon:r,color:"#3b82f6",link:"/admin/submissions/contacts"},{label:"Newsletter Subs",value:t.newsletterSubs,icon:g,color:"#10b981",link:"/admin/submissions/newsletter"},{label:"Demo Requests",value:t.demoRequests,icon:D,color:"#8b5cf6",link:"/admin/submissions/demos"},{label:"Active Jobs",value:t.activeJobs,icon:o,color:"#f59e0b",link:"/admin/jobs"}],h={create:"text-green-400",update:"text-blue-400",delete:"text-red-400",publish:"text-purple-400"};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-white text-[22px]",style:{fontWeight:600},children:"Dashboard"}),e.jsx("p",{className:"text-white/40 text-[14px] mt-0.5",children:"Overview of your CMS content and activity"})]}),e.jsxs("button",{onClick:N,disabled:d,className:"flex items-center gap-2 text-[12px] text-white/40 hover:text-white/70 border border-white/10 hover:border-white/20 rounded-lg px-3 py-2 transition-colors disabled:opacity-50",children:[e.jsx(T,{className:`w-3.5 h-3.5 ${d?"animate-spin":""}`}),"Reset Data"]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-gradient-to-br from-[#3b82f6]/15 to-[#3b82f6]/5 border border-[#3b82f6]/20 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(q,{className:"w-4 h-4 text-[#3b82f6]"}),e.jsx("span",{className:"text-white/50 text-[12px]",children:"Total Content"})]}),e.jsx("p",{className:"text-white text-[24px]",style:{fontWeight:600},children:t.blogPosts+t.caseStudies+t.products+t.industries})]}),e.jsxs("div",{className:"bg-gradient-to-br from-[#8b5cf6]/15 to-[#8b5cf6]/5 border border-[#8b5cf6]/20 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(r,{className:"w-4 h-4 text-[#8b5cf6]"}),e.jsx("span",{className:"text-white/50 text-[12px]",children:"New Contacts"})]}),e.jsx("p",{className:"text-white text-[24px]",style:{fontWeight:600},children:t.newContacts})]}),e.jsxs("div",{className:"bg-gradient-to-br from-[#10b981]/15 to-[#10b981]/5 border border-[#10b981]/20 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(g,{className:"w-4 h-4 text-[#10b981]"}),e.jsx("span",{className:"text-white/50 text-[12px]",children:"Subscribers"})]}),e.jsx("p",{className:"text-white text-[24px]",style:{fontWeight:600},children:t.newsletterSubs})]}),e.jsxs("div",{className:"bg-gradient-to-br from-[#f59e0b]/15 to-[#f59e0b]/5 border border-[#f59e0b]/20 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(o,{className:"w-4 h-4 text-[#f59e0b]"}),e.jsx("span",{className:"text-white/50 text-[12px]",children:"Active Jobs"})]}),e.jsx("p",{className:"text-white text-[24px]",style:{fontWeight:600},children:t.activeJobs})]})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-white/70 text-[13px] uppercase tracking-wider mb-3",style:{fontWeight:500},children:"Content"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:v.map(s=>{const i=s.icon;return e.jsxs(l,{to:s.link,className:"group bg-[#14132a] border border-white/5 hover:border-white/15 rounded-xl p-4 transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center",style:{backgroundColor:s.color+"15"},children:e.jsx(i,{className:"w-4.5 h-4.5",style:{color:s.color}})}),e.jsx(n,{className:"w-4 h-4 text-white/20 group-hover:text-white/50 transition-colors"})]}),e.jsx("p",{className:"text-white text-[20px] mb-0.5",style:{fontWeight:600},children:s.value}),e.jsx("p",{className:"text-white/40 text-[12px]",children:s.label})]},s.label)})})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-white/70 text-[13px] uppercase tracking-wider mb-3",style:{fontWeight:500},children:"Submissions & Jobs"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:y.map(s=>{const i=s.icon;return e.jsxs(l,{to:s.link,className:"group bg-[#14132a] border border-white/5 hover:border-white/15 rounded-xl p-4 transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center",style:{backgroundColor:s.color+"15"},children:e.jsx(i,{className:"w-4.5 h-4.5",style:{color:s.color}})}),e.jsx(n,{className:"w-4 h-4 text-white/20 group-hover:text-white/50 transition-colors"})]}),e.jsx("p",{className:"text-white text-[20px] mb-0.5",style:{fontWeight:600},children:s.value}),e.jsx("p",{className:"text-white/40 text-[12px]",children:s.label})]},s.label)})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-[#14132a] border border-white/5 rounded-xl",children:[e.jsx("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{className:"w-4 h-4 text-white/40"}),e.jsx("h3",{className:"text-white text-[14px]",style:{fontWeight:500},children:"Recent Activity"})]})}),e.jsx("div",{className:"divide-y divide-white/5 max-h-[400px] overflow-y-auto",children:c.length===0?e.jsx("div",{className:"px-5 py-8 text-center text-white/30 text-[13px]",children:"No activity yet"}):c.map(s=>e.jsxs("div",{className:"px-5 py-3 flex items-start gap-3",children:[e.jsx("div",{className:`mt-0.5 ${h[s.action]||"text-white/40"}`,children:e.jsx(J,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-white/70 text-[13px] truncate",children:s.summary}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx("span",{className:`text-[11px] capitalize ${h[s.action]||"text-white/40"}`,children:s.action}),e.jsx("span",{className:"text-white/20 text-[11px]",children:s.entityType}),e.jsx("span",{className:"text-white/15 text-[11px]",children:new Date(s.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]},s.id))})]}),e.jsxs("div",{className:"bg-[#14132a] border border-white/5 rounded-xl",children:[e.jsx("div",{className:"px-5 py-4 border-b border-white/5",children:e.jsx("h3",{className:"text-white text-[14px]",style:{fontWeight:500}
1,children:"Quick Actions"})}),e.jsx("div",{className:"p-5 space-y-2.5",children:[{label:"Create Blog Post",link:"/admin/blog-posts?action=create",icon:b,color:"#3b82f6"},{label:"Add Case Study",link:"/admin/case-studies?action=create",icon:p,color:"#8b5cf6"},{label:"Add Testimonial",link:"/admin/testimonials?action=create",icon:u,color:"#10b981"},{label:"Post New Job",link:"/admin/jobs?action=create",icon:o,color:"#f59e0b"},{label:"Add FAQ",link:"/admin/faqs?action=create",icon:w,color:"#14b8a6"},{label:"View Contact Forms",link:"/admin/submissions/contacts",icon:r,color:"#ec4899"}].map(s=>{const i=s.icon;return e.jsxs(l,{to:s.link,className:"flex items-center gap-3 px-4 py-3 rounded-lg bg-white/3 hover:bg-white/6 border border-white/5 hover:border-white/10 transition-all group",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{backgroundColor:s.color+"15"},children:e.jsx(i,{className:"w-4 h-4",style:{color:s.color}})}),e.jsx("span",{className:"text-white/60 text-[13px] group-hover:text-white/90 transition-colors",style:{fontWeight:500},children:s.label}),e.jsx(n,{className:"w-3.5 h-3.5 text-white/15 group-hover:text-white/40 ml-auto transition-colors"})]},s.label)})})]})]})]})}export{B as AdminDashboard};
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.