import{_ as C}from"./Zi85nIMD.js";import{d as N,x as v,c as B,b as r,e as s,w as t,j as n,f as e,H as b,G as _,J as D,K as T,E as d,L as m,D as i,Q as w,s as p,F as A,y as G,l as h,_ as L}from"./DGA3dmy8.js";import{G as V,U as E}from"./W8zwORWN.js";import{B as F}from"./BGI1QYR-.js";import{D as I,u as H}from"./CdvIQPoS.js";import{I as U}from"./CCeWr_SP.js";import"./DA91-Zfy.js";const $={class:"font-bold"},j={class:"flex gap-2"},J={key:0,class:"text-muted-foreground"},K={key:1,class:"text-destructive italic text-sm"},W=N({__name:"index",async setup(Q){let u,f;const{data:g}=([u,f]=v(()=>H("/api/articles/list","$967brEd123")),u=await u,f(),u),o=B(()=>{var c;return((c=g.value)==null?void 0:c.articles)??[]});return(c,l)=>{const y=C,k=L;return s(),r(k,{name:"default",path:["Articles"]},{default:t(()=>[n(e(b),null,{default:t(()=>[n(e(D),null,{default:t(()=>[n(e(T),null,{default:t(()=>l[0]||(l[0]=[d("Articles")])),_:1,__:[0]}),!e(o)||e(o).length===0?(s(),r(e(m),{key:0},{default:t(()=>l[1]||(l[1]=[d("There are no articles.")])),_:1,__:[1]})):e(o).length===1?(s(),r(e(m),{key:1},{default:t(()=>l[2]||(l[2]=[d("There is 1 article.")])),_:1,__:[2]})):(s(),r(e(m),{key:2},{default:t(()=>[d("There are "+i(e(o).length)+" articles.",1)]),_:1}))]),_:1}),e(o)&&e(o).length>0?(s(),r(e(w),{key:0,class:"px-0 pb-0"},{default:t(()=>{var x;return[n(V,{items:((x=e(o))==null?void 0:x.length)??0,variant:"card"},{default:t(()=>[(s(!0),p(A,null,G(e(o)??[],a=>(s(),r(E,{key:a.fileName},{default:t(()=>[n(y,{to:`articles/${a.fileName}`,class:"flex flex-col gap-1 h-full px-3 pb-3 pt-2 hover:bg-accent/50"},{default:t(()=>[h("h2",$,i(a.title),1),h("div",j,[a.metadata.author?(s(),r(e(F),{key:0,variant:"outline",class:"flex gap-2"},{default:t(()=>[n(e(U),{icon:"lucide:user-round"}),d(" "+i(a.metadata.author),1)]),_:2},1024)):_("",!0),n(I,{date:a.uploadDate,variant:"outline"},null,8,["date"])]),a.metadata.description?(s(),p("p",J,i(a.metadata.description),1)):_("",!0),a.error?(s(),p("p",K,i(a.error),1)):_("",!0)]),_:2},1032,["to"])]),_:2},1024))),128))]),_:1},8,["items"])]}),_:1})):_("",!0)]),_:1})]),_:1})}}});export{W as default};
//# sourceMappingURL=BTT8c6rI.js.map
