import{e as v,J as x,j as f,c as e,a as s,b as d,t as o,f as n,F as y,r as b,i as m,E as w,o as a}from"./DpdQcRr7.js";import"./BcpEzrWT.js";const z={class:"section"},k={class:"container"},C={class:"columns mb-5"},A={class:"column is-one-third"},B={class:"box"},N={class:"is-flex is-align-items-center"},S={class:"mr-4"},j={class:"icon is-large has-text-info"},D={class:"is-size-4 has-text-weight-semibold"},E={class:"column is-one-third"},F={class:"box"},I={class:"is-flex is-align-items-center"},J={class:"mr-4"},L={class:"icon is-large has-text-success"},O={class:"is-size-4 has-text-weight-semibold"},P={class:"column is-one-third"},U={class:"box"},V={class:"is-flex is-align-items-center"},M={class:"mr-4"},R={class:"icon is-large has-text-purple"},T={class:"is-size-4 has-text-weight-semibold"},$={class:"box"},q={key:0,class:"has-text-grey has-text-centered py-6"},G={key:1,class:"content"},H={class:"is-flex is-align-items-start"},K={class:"icon has-text-info mr-3"},Q={class:"is-size-6 mb-1"},W={class:"is-size-7 has-text-grey"},ss=v({__name:"index",setup(X){const c=m({totalUsers:0,totalCompanies:0,totalOrganizations:0}),r=m([]),{$api:_}=x(),p=t=>t?new Date(t).toLocaleString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"",u=async()=>{try{const t=await _("/api/admin/stats");c.value=t}catch(t){console.error("統計情報の取得に失敗しました:",t)}},g=async()=>{try{const t=await _("/api/admin/activities/recent");r.value=t.activities}catch(t){console.error("アクティビティの取得に失敗しました:",t)}};return f(async()=>{await Promise.all([u(),g()])}),(t,i)=>{const l=w("Icon");return a(),e("section",z,[s("div",k,[i[4]||(i[4]=s("h1",{class:"title is-3 mb-5"},"管理画面ダッシュボード",-1)),s("div",C,[s("div",A,[s("div",B,[s("div",N,[s("div",S,[s("span",j,[d(l,{icon:"mdi:account-multiple",width:32,height:32})])]),s("div",null,[i[0]||(i[0]=s("p",{class:"is-size-7 has-text-grey"},"総ユーザー数",-1)),s("p",D,o(n(c).totalUsers),1)])])])]),s("div",E,[s("div",F,[s("div",I,[s("div",J,[s("span",L,[d(l,{icon:"mdi:office-building",width:32,height:32})])]),s("div",null,[i[1]||(i[1]=s("p",{class:"is-size-7 has-text-grey"},"総企業数",-1)),s("p",O,o(n(c).totalCompanies),1)])])])]),s("div",P,[s("div",U,[s("div",V,[s("div",M,[s("span",R,[d(l,{icon:"mdi:account-group",width:32,height:32})])]),s("div",null,[i[2]||(i[2]=s("p",{class:"is-size-7 has-text-grey"},"総組織数",-1)),s("p",T,o(n(c).totalOrganizations),1)])])])])]),s("div",$,[i[3]||(i[3]=s("h3",{class:"title is-5 mb-4"},"最近のアクティビティ",-1)),n(r).length===0?(a(),e("div",q," アクティビティはありません ")):(a(),e("div",G,[(a(!0),e(y,null,b(n(r),h=>(a(),e("div",{key:h.id,class:"mb-4"},[s("div",H,[s("span",K,[d(l,{icon:"mdi:circle-small"})]),s("div",null,[s("p",Q,o(h.message),1),s("p",W,o(p(h.timestamp)),1)])])]))),128))]))])])])}}});export{ss as default};
