import{_ as C}from"./CVsqerjz.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,J as b,H as c,K as D,L as T,E as d,M as m,D as i,Q as w,s as p,F as A,y as L,l as h,_ as V}from"./Dyw2fVvW.js";import{G as E,U as F}from"./D3rZehCf.js";import{B as G}from"./D1pXEC3O.js";import{D as I,u as H}from"./-Bz3yqNb.js";import{I as U}from"./4ryIOjig.js";import"./CGYxsk1h.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(M){let u,f;const{data:g}=([u,f]=v(()=>H("/api/articles/list","$967brEd123")),u=await u,f(),u),o=B(()=>{var _;return((_=g.value)==null?void 0:_.articles)??[]});return(_,l)=>{const y=C,k=V;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}),!e(o)||e(o).length===0?(s(),r(e(m),{key:0},{default:t(()=>l[1]||(l[1]=[d("There are no articles.")])),_:1})):e(o).length===1?(s(),r(e(m),{key:1},{default:t(()=>l[2]||(l[2]=[d("There is 1 article.")])),_:1})):(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(E,{items:((x=e(o))==null?void 0:x.length)??0,variant:"card"},{default:t(()=>[(s(!0),p(A,null,L(e(o)??[],a=>(s(),r(F,{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(G),{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)):c("",!0),n(I,{date:a.uploadDate,variant:"outline"},null,8,["date"])]),a.metadata.description?(s(),p("p",J,i(a.metadata.description),1)):c("",!0),a.error?(s(),p("p",K,i(a.error),1)):c("",!0)]),_:2},1032,["to"])]),_:2},1024))),128))]),_:1},8,["items"])]}),_:1})):c("",!0)]),_:1})]),_:1})}}});export{W as default};
