import{u as f}from"./BZ7f31ti.js";import{u as p,q as m,c as i,a as s,t,e as a,i as g,F as v,r as h,l as u,o as e,n as y}from"./BKiFavna.js";import{_ as w}from"./DlAUqK2U.js";const k={class:"page-hdr"},P={key:0,class:"stats-grid"},N={class:"stat-card blue"},x={class:"stat-info"},T={class:"stat-label"},V={class:"stat-value"},C={class:"stat-sub"},D={class:"stat-card green"},B={class:"stat-info"},S={class:"stat-label"},F={class:"stat-value"},I={class:"stat-card orange"},M={class:"stat-info"},q={class:"stat-label"},z={class:"stat-value"},A={class:"stat-sub"},E={class:"stat-card purple"},L={class:"stat-info"},R={class:"stat-label"},U={class:"stat-value"},$={class:"stat-card teal"},j={class:"stat-info"},G={class:"stat-label"},H={class:"stat-value"},J={class:"stat-card pink"},K={class:"stat-info"},O={class:"stat-label"},Q={class:"stat-value"},W={class:"stat-sub"},X={class:"stat-card red"},Y={class:"stat-info"},Z={class:"stat-label"},ss={class:"stat-value"},ts={class:"stat-card indigo"},as={class:"stat-info"},os={class:"stat-label"},ls={class:"stat-value"},ns={class:"dash-grid"},is={class:"dash-card"},es={key:0,class:"ad-table"},ds={key:1,class:"empty"},cs={class:"dash-card"},_s={key:0,class:"ad-table"},rs={key:1,class:"empty"},us={__name:"index",setup(vs){const{lang:n}=p(),{api:b}=f(),l=u(null),_=u([]),r=u([]);return m(async()=>{try{const c=await b.get("/admin/stats");l.value=c.data.stats,_.value=c.data.recentPosts,r.value=c.data.topPosts}catch(c){console.error(c)}}),(c,o)=>(e(),i("div",null,[s("h1",k,t(a(n)==="bn"?"ড্যাশবোর্ড":"Dashboard"),1),a(l)?(e(),i("div",P,[s("div",N,[o[0]||(o[0]=s("div",{class:"stat-icon"},[s("i",{class:"fas fa-newspaper"})],-1)),s("div",x,[s("div",T,t(a(n)==="bn"?"মোট পোস্ট":"Total Posts"),1),s("div",V,t(a(l).posts.total),1),s("div",C,"Published: "+t(a(l).posts.published||0)+" | Drafts: "+t(a(l).posts.drafts||0),1)])]),s("div",D,[o[1]||(o[1]=s("div",{class:"stat-icon"},[s("i",{class:"fas fa-users"})],-1)),s("div",B,[s("div",S,t(a(n)==="bn"?"ইউজার":"Users"),1),s("div",F,t(a(l).users.total),1)])]),s("div",I,[o[2]||(o[2]=s("div",{class:"stat-icon"},[s("i",{class:"fas fa-comments"})],-1)),s("div",M,[s("div",q,t(a(n)==="bn"?"কমেন্ট":"Comments"),1),s("div",z,t(a(l).comments.total),1),s("div",A,"Pending: "+t(a(l).comments.pending||0),1)])]),s("div",E,[o[3]||(o[3]=s("div",{class:"stat-icon"},[s("i",{class:"fas fa-eye"})],-1)),s("div",L,[s("div",R,t(a(n)==="bn"?"মোট ভিউ":"Total Views"),1),s("div",U,t(a(l).views.total),1)])]),s("div",$,[o[4]||(o[4]=s("div",{class:"stat-icon"},[s("i",{class:"fas fa-envelope"})],-1)),s("div",j,[s("div",G,t(a(n)==="bn"?"সাবস্ক্রাইবার":"Subscribers"),1),s("div",H,t(a(l).newsletter.total),1)])]),s("div",J,[o[5]||(o[5]=s("div",{class:"stat-icon"},[s("i",{class:"fas fa-hand-holding-heart"})],-1)),s("div",K,[s("div",O,t(a(n)==="bn"?"ডোনেশন":"Donations"),1),s("div",Q,"৳"+t(a(l).donations.amount||0),1),s("div",W,"Count: "+t(a(l).donations.total||0),1)])]),s("div",X,[o[6]||(o[6]=s("div",{class:"stat-icon"},[s("i",{class:"fas fa-inbox"})],-1)),s("div",Y,[s("div",Z,t(a(n)==="bn"?"বার্তা (নতুন)":"Messages (New)"),1),s("div",ss,t(a(l).contact.total),1)])]),s("div",ts,[o[7]||(o[7]=s("div",{class:"stat-icon"},[s("i",{class:"fas fa-lightbulb"})],-1)),s("div",as,[s("div",os,t(a(n)==="bn"?"টিপস (নতুন)":"Tips (New)"),1),s("div",ls,t(a(l).tips.total),1)])])])):g("",!0),s("div",ns,[s("div",is,[s("h3",null,t(a(n)==="bn"?"সর্বশেষ পোস্ট":"Recent Posts"),1),a(_).length?(e(),i("table",es,[s("thead",null,[s("tr",null,[s("th",null,t(a(n)==="bn"?"শিরোনাম":"Title"),1),o[8]||(o[8]=s("th",null,"Status",-1)),o[9]||(o[9]=s("th",null,"Views",-1))])]),s("tbody",null,[(e(!0),i(v,null,h(a(_),d=>(e(),i("tr",{key:d.id},[s("td",null,t(d.title_bn),1),s("td",null,[s("span",{class:y(`badge badge-${d.status}`)},t(d.status),3)]),s("td",null,t(d.views),1)]))),128))])])):(e(),i("p",ds,"No recent posts"))]),s("div",cs,[s("h3",null,t(a(n)==="bn"?"জনপ্রিয় পোস্ট":"Top Posts"),1),a(r).length?(e(),i("table",_s,[s("thead",null,[s("tr",null,[s("th",null,t(a(n)==="bn"?"শিরোনাম":"Title"),1),o[10]||(o[10]=s("th",null,"Views",-1))])]),s("tbody",null,[(e(!0),i(v,null,h(a(r),d=>(e(),i("tr",{key:d.id},[s("td",null,t(d.title_bn),1),s("td",null,t(d.views),1)]))),128))])])):(e(),i("p",rs,"No data"))])])]))}},ps=w(us,[["__scopeId","data-v-c215c663"]]);export{ps as default};
