import{e as k,x as b,J as x,j,c as n,f as c,a as s,b as _,t as o,F as w,r as C,i as u,E as D,o as i,h as v,_ as N}from"./DpdQcRr7.js";import"./BcpEzrWT.js";const B={key:0,class:"state-box"},I={key:1,class:"error-box"},V={key:2,class:"empty-state"},E={key:3,class:"proj-list"},F={class:"proj-icon"},J={class:"proj-main"},L={class:"proj-name-row"},M={class:"proj-name"},P={class:"tag tag-info"},S={class:"tag"},$={key:0,class:"proj-desc"},z={class:"proj-meta"},A={key:0},R=k({__name:"projects",setup(q){const y=b(),{$api:f}=x(),g=y.params.id,d=u([]),p=u(!1),r=u(""),m=async()=>{var l,a;p.value=!0,r.value="";try{const t=await f(`/api/organization/users/${g}/projects`);d.value=t.projects||[]}catch(t){r.value=((a=(l=t==null?void 0:t.response)==null?void 0:l.data)==null?void 0:a.detail)||(t==null?void 0:t.message)||"プロジェクト一覧の取得に失敗しました"}finally{p.value=!1}},h=l=>new Date(l).toLocaleDateString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit"});return j(()=>{m()}),(l,a)=>{const t=D("Icon");return i(),n("div",null,[c(p)?(i(),n("div",B,[...a[0]||(a[0]=[s("div",{class:"loader"},null,-1),s("p",null,"読み込み中...",-1)])])):c(r)?(i(),n("div",I,[s("div",null,[_(t,{icon:"mdi:alert-circle-outline",width:18,height:18}),s("span",null,o(c(r)),1)]),s("button",{class:"btn btn-secondary btn-sm",onClick:m},"再試行")])):c(d).length===0?(i(),n("div",V,[_(t,{icon:"mdi:folder-multiple-outline",width:48,height:48,class:"empty-icon"}),a[1]||(a[1]=s("p",{class:"empty-title"},"プロジェクトがありません",-1)),a[2]||(a[2]=s("p",{class:"empty-sub"},"このユーザーはまだプロジェクトを作成していません。",-1))])):(i(),n("div",E,[(i(!0),n(w,null,C(c(d),e=>(i(),n("div",{key:e.id,class:"proj-card"},[s("span",F,[_(t,{icon:"mdi:minecraft",width:30,height:30})]),s("div",J,[s("div",L,[s("span",M,o(e.name),1),s("span",P,o(e.mod_loader),1),s("span",S,"v"+o(e.version),1)]),e.description?(i(),n("p",$,o(e.description),1)):v("",!0),s("p",z,[s("span",null,"MC "+o(e.minecraft_version),1),s("span",null," | "+o(e.package_name),1),s("span",null," | 作成日: "+o(h(e.created_at)),1),e.last_synced_at?(i(),n("span",A," | 最終同期: "+o(h(e.last_synced_at)),1)):v("",!0)])])]))),128))]))])}}}),K=N(R,[["__scopeId","data-v-4f8843d9"]]);export{K as default};
