1import{o,j as s,ap as p,V as f,L as b,g as j,s as l}from"./index-DuBrVlzG.js";import{U as y}from"./user-plus-C1NqlZMz.js";const L=()=>{const{data:i,isLoading:d}=o({queryKey:["admin-blog-stats"],queryFn:async()=>{const{data:t}=await l.from("blog_posts").select("status"),e=t||[];return{total:e.length,published:e.filter(a=>a.status==="publish").length,drafts:e.filter(a=>a.status==="draft").length,scheduled:e.filter(a=>a.status==="scheduled").length}}}),{data:r,isLoading:c}=o({queryKey:["admin-listing-count"],queryFn:async()=>{const{count:t}=await l.from("listings").select("*",{count:"exact",head:!0}).eq("status","active");return t||0}}),{data:u,isLoading:g}=o({queryKey:["admin-signup-count"],queryFn:async()=>{const t=new Date;t.setDate(t.getDate()-30);const{count:e}=await l.from("profiles").select("*",{count:"exact",head:!0}).gte("created_at",t.toISOString());return e||0}}),n=({title:t,value:e,subtitle:a,icon:m,loading:x,to:h})=>s.jsx(b,{to:h,className:"block",children:s.jsxs("div",{className:"stat-card cursor-pointer",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("span",{className:"text-sm font-semibold text-[#6b7280] uppercase tracking-wide",children:t}),s.jsx(m,{size:20,className:"text-[#9ca3af]"})]}),x?s.jsx(j,{className:"h-8 w-20"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-3xl font-headline font-extrabold text-[#111827]",children:e}),a&&s.jsx("p",{className:"text-sm text-[#6b7280] mt-1 font-body",children:a})]})]})});return s.jsxs("div",{children:[s.jsx("h1",{className:"mb-8",children:"Dashboard"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsx(n,{title:"Blog Posts",value:(i==null?void 0:i.total)??0,subtitle:i?`${i.published} published · ${i.drafts} drafts · ${i.scheduled} scheduled`:void 0,icon:p,loading:d,to:"/admin/blog"}),s.jsx(n,{title:"Active Listings",value:r??0,icon:f,loading:c,to:"/admin/listings"}),s.jsx(n,{title:"New Signups (30d)",value:u??0,icon:y,loading:g,to:"/admin/users"})]})]})};export{L as default}; 2//# sourceMappingURL=AdminDashboard-BQ0rs2bX.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.