import{z as y,r as n,aB as j,aC as u,aD as m,j as a,aE as f,B as v,t as C,C as k,v as w,aF as b,aG as B,aH as E,aI as A,aJ as S,aK as O}from"./index-COCGZQB3.js";const $=()=>{const{project:c}=y(),[t,d]=n.useState([]),p=j(),x=u(),l=m(e=>e.menu.items),h=async()=>{O(x)};return n.useEffect(()=>{const e=l.map(r=>({name:r.name,items:r.items.map(s=>({key:`${c}/${s.path}`,label:s.name,img:s.img,tags:s.tags,description:s.description,category:s.category}))}));d(e)},[JSON.stringify(l)]),a.jsxs("div",{style:{maxWidth:"1500px",margin:"1rem auto"},children:[a.jsx(f,{justify:"flex-end",gap:"small",children:a.jsx(v,{color:"cyan",variant:"solid",onClick:h,children:"刷新"})}),Array.isArray(t)&&t.length!=0?t.map((e,r)=>a.jsxs("div",{children:[a.jsx("h2",{children:e.name}),a.jsx("hr",{}),a.jsx(C,{gutter:16,children:e==null?void 0:e.items.map((s,g)=>a.jsx(k,{lg:4,sm:6,xs:24,style:{marginBottom:"1rem",cursor:"pointer"},children:a.jsxs(w,{hoverable:!0,style:{height:"100%"},cover:a.jsx("img",{alt:s.label,src:s.img}),onClick:()=>p(`/${s.key}`),children:[a.jsx(b,{title:s.label,description:s==null?void 0:s.description,style:{marginBottom:"1rem"}}),s.tags&&Array.isArray(s.tags)&&s.tags.map((o,i)=>a.jsx(B,{title:o,children:a.jsx(E,{style:{wordBreak:"break-word",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:100,display:"inline-block",cursor:"default"},color:A[i],children:o})},i))]})},g))})]},r)):a.jsx(S,{}),!1]})};export{$ as default};
