1import{r as e,j as s,L as a}from"./vendor-react-DejgYtBM.js";import{u as t,Y as r,A as i,s as l}from"./index-BeIIFw6E.js";import{f as d,B as c,l as n,E as x,I as m,b as o,m as h,N as g}from"./vendor-semi-D8d7bTtM.js";import{A as j,r as p}from"./articleUtils-CS9XG6di.js";import{y,z as b,A as f,E as u}from"./vendor-icons-EJvJ5X-w.js";import"./vendor-motion-Chfy_MiU.js";import"./marked.esm-B28mcIGu.js";import"./purify.es-Bm-lHtoJ.js";import"./vendor-highlight-CaHTjBxz.js";const{Title:N,Text:v}=d,w=()=>{const{t:d}=t(),[w,k]=e.useState([]),[z,S]=e.useState(null),[I,T]=e.useState(!0);return e.useEffect(()=>{(async()=>{T(!0);try{const e=await i.get("/api/news?size=100"),{success:s,data:a,message:t}=e.data;if(s){const e=a||[];k(e),e.length>0&&S(e[0])}else l(t||d("å è½½æç« 失败"))}catch(e){l(e.message||d("å è½½æç« 失败"))}finally{T(!1)}})()},[]),s.jsx("div",{className:"px-4 py-8",children:s.jsxs("div",{className:"w-full max-w-7xl mx-auto",children:[s.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs(N,{heading:2,className:"!mb-2 flex items-center gap-3",children:[s.jsx(y,{className:"text-blue-500",size:28}),d("æç« èµè®¯")]}),s.jsx(v,{type:"tertiary",children:d("äºè§£ææ°å¨æåå
¬å")})]}),s.jsx(a,{to:"/news/focus",children:s.jsx(c,{theme:"light",size:"large",icon:s.jsx(b,{size:18}),className:"!px-5 !font-medium !shadow-sm hover:!shadow-md",children:d("å表模å¼")})})]}),I?s.jsx("div",{className:"flex justify-center items-center py-20",children:s.jsx(n,{size:"large"})}):0===w.length?s.jsx(x,{image:s.jsx(o,{style:{width:200,height:200}}),darkModeImage:s.jsx(m,{style:{width:200,height:200}}),title:d("ææ æç« "),description:d("è¿æ²¡æåå¸ä»»ä½æç« "),className:"py-20"}):s.jsxs("div",{className:"flex gap-6 flex-col lg:flex-row",children:[s.jsx("div",{className:"w-full lg:w-80 flex-shrink-0",children:s.jsxs(h,{className:"!rounded-2xl !shadow-lg !border-0 sticky top-24",bodyStyle:{padding:0},children:[s.jsxs("div",{className:"p-4 border-b border-gray-100 dark:border-gray-700",children:[s.jsx(v,{strong:!0,className:"text-base",children:d("æç« å表")}),s.jsxs(v,{type:"tertiary",className:"ml-2",children:["(",w.length,")"]})]}),s.jsx("div",{className:"max-h-[600px] overflow-y-auto",children:s.jsx(g,{dataSource:w,renderItem:e=>s.jsxs("div",{onClick:()=>{return s=e,void(z?.id!==s.id&&S(s));var s},className:"px-4 py-3 cursor-pointer transition-all border-l-2 "+(z?.id===e.id?"bg-blue-50 dark:bg-blue-900/30 border-l-blue-500":"bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 border-l-transparent"),children:[s.jsx(v,{strong:!0,ellipsis:{showTooltip:!0},className:"block !text-sm "+(z?.id===e.id?"!text-blue-600 dark:!text-blue-400":""),children:e.title}),s.jsxs("div",{className:"flex items-center gap-3 mt-1.5",children:[s.jsxs("span",{className:"flex items-center gap-1 text-xs text-gray-400",children:[s.jsx(f,{size:12}),r(e.created_at).split(" ")[0]]}),s.jsxs("span",{className:"flex items-center gap-1 text-xs text-gray-400",children:[s.jsx(u,{size:12}),e.views]})]})]},e.id)})})]})}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(h,{className:"!rounded-2xl !shadow-lg !border-0",bodyStyle:{padding:0},children:z?s.jsxs("div",{className:"p-6 lg:p-8",children:[s.jsx(N,{heading:3,className:"!mb-6",children:z.title}),s.jsx("div",{className:j,dangerouslySetInnerHTML:{__html:p(z.content||"")}}),s.jsxs("div",{className:"flex items-center gap-4 mt-8 pt-4 border-t border-gray-100 dark:border-gray-700",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-gray-400",children:[s.jsx(f,{size:14}),r(z.created_at)]}),s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-gray-400",children:[s.jsx(u,{size:14}),z.views," ",d("次æµè§")]})]})]}):s.jsx(x,{image:s.jsx(o,{style:{width:150,height:150}}),darkModeImage:s.jsx(m,{style:{width:150,height:150}}),title:d("éæ©ä¸ç¯æç« "),description:d("ç¹å»å·¦ä¾§æç« å表æ¥çå
容"),className:"py-20"})})})]})]})})};export{w as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.