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