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