import{_ as g}from"./Ba76BwjT.js";import{e as w,j as k,B as b,c as n,a as s,b as m,y as x,z as C,f as l,D as L,F as N,r as B,i as p,E as F,o,H as f,w as V,t as r,h as P,G as S,_ as U}from"./DpdQcRr7.js";import{u as D}from"./DnDgEkgi.js";import{P as I}from"./MNmNWAT4.js";import{u as $}from"./DuJ0NDcC.js";import"./BcpEzrWT.js";import"./D1zzHZdQ.js";const q={class:"sp-page"},A={class:"sp-container"},E={class:"page-header"},M={class:"search-bar"},R={class:"search-input-wrapper"},j={key:0,class:"empty-state"},z={key:1,class:"empty-state"},G={key:2,class:"projects-grid"},H={class:"card-thumbnail"},Q=["src"],T={class:"card-body"},J={class:"card-title"},K={key:0,class:"card-desc"},O={class:"card-tags"},W={class:"card-tag"},X={class:"card-tag"},Y={class:"card-footer"},Z={class:"card-date"},ss=w({__name:"index",setup(ts){const _=D(),c=p([]),u=p(!1),i=p(""),v=async()=>{u.value=!0;try{const a=await $("/api/user");c.value=(a.shared_projects||[]).map(t=>new I(t))}catch{c.value=[]}finally{u.value=!1}},h=S(()=>{if(!i.value)return c.value;const a=i.value.toLowerCase();return c.value.filter(t=>t.name.toLowerCase().includes(a)||(t.projectName||"").toLowerCase().includes(a)||(t.description||"").toLowerCase().includes(a))});return k(()=>{_.showFooter=!1,v()}),b(()=>{_.showFooter=!0}),(a,t)=>{const d=F("Icon"),y=g;return o(),n("div",q,[s("div",A,[s("div",E,[s("button",{class:"back-btn",onClick:t[0]||(t[0]=e=>a.$router.back())},[m(d,{icon:"mdi:arrow-left",width:16,height:16}),t[2]||(t[2]=s("span",null,"戻る",-1))]),t[3]||(t[3]=s("h1",{class:"page-title"},"公開されたプロジェクト",-1))]),s("div",M,[s("div",R,[m(d,{icon:"mdi:magnify",width:18,height:18,class:"search-icon"}),x(s("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>L(i)?i.value=e:null),class:"search-input",type:"text",placeholder:"プロジェクトを検索..."},null,512),[[C,l(i)]])])]),l(u)?(o(),n("div",j,[...t[4]||(t[4]=[s("div",{class:"loader"},null,-1),s("p",null,"読み込み中...",-1)])])):l(h).length===0?(o(),n("div",z,[m(d,{icon:"mdi:earth",width:48,height:48,class:"empty-icon"}),t[5]||(t[5]=s("p",{class:"empty-text"},"公開されたプロジェクトはありません",-1))])):(o(),n("div",G,[(o(!0),n(N,null,B(l(h),e=>(o(),f(y,{key:e.id,to:`/user/shred-projects/${e.id}`,class:"project-card"},{default:V(()=>[s("div",H,[e.thumbnailUrl?(o(),n("img",{key:0,src:e.thumbnailUrl,alt:"",class:"card-thumbnail-img"},null,8,Q)):(o(),f(d,{key:1,icon:"mdi:cube-outline",width:32,height:32}))]),s("div",T,[s("h3",J,r(e.displayName),1),e.description?(o(),n("p",K,r(e.description),1)):P("",!0),s("div",O,[s("span",W,r(e.modLoader),1),s("span",X,r(e.minecraftVersion),1)])]),s("div",Y,[s("span",Z,r(e.updatedAtFormatted),1)])]),_:2},1032,["to"]))),128))]))])])}}}),ds=U(ss,[["__scopeId","data-v-47905ef2"]]);export{ds as default};
