PageSourceSearch

https://www.almesbar.net/assets-vite/Books-DM_SAvEH.js

js almesbar.net collected 2026-09-25 00:55:22 UTC 1,968 bytes, 1 lines download raw bytes

1import{a as d,j as t}from"./index-D5uQ2A58.js";import{u as N,r as s}from"./vendor-QBELzlxK.js";import{u as S,a as y,b as C}from"./hooks-B21J7nAM.js";import{S as E}from"./SectionHead-CVGl532i.js";const k=16;function A(){S("كتب المركز");const m=N(),[n,u]=s.useState(""),[i,p]=s.useState(""),[a,r]=s.useState(""),[f,x]=s.useState([]),{items:l,count:h,loading:c,load:o,reset:j}=y(e=>d.getBooks("books",i,e,k,a||""),[i,a]);s.useEffect(()=>{d.getList("dropdown").then(e=>x((e.data||[]).sort((v,b)=>v-b))).catch(()=>{})},[]),s.useEffect(()=>{j(),o()},[i,a]),C(o);const g=e=>{localStorage.setItem("id",e._id),m(`/books/${e.id}`)};return t.jsxs("div",{className:"container wide",children:[t.jsx(E,{title:"كتب المركز",kicker:"إصدارات شهرية",count:h,as:"h1"}),t.jsxs("div",{className:"filterbar",style:{justifyContent:"center"},"aria-label":"تصفية حسب السنة",children:[t.jsx("button",{type:"button",className:`fbtn${a===""?" on":""}`,onClick:()=>r(""),children:"الكل"}),f.map(e=>t.jsx("button",{type:"button",className:`fbtn${String(a)===String(e)?" on":""}`,onClick:()=>r(e),children:e},e))]}),t.jsx("div",{className:"filterbar",style:{justifyContent:"center"},children:t.jsxs("form",{onSubmit:e=>{e.preventDefault(),p(n)},style:{display:"flex",gap:8},children:[t.jsx("input",{type:"text",placeholder:"ابحث في الكتب…",value:n,onChange:e=>u(e.target.value)}),t.jsx("button",{className:"btn",type:"submit",children:"بحث"})]})}
1),t.jsx("div",{className:"covers-grid",children:l.map(e=>t.jsx("div",{className:"card covercard cursor",onClick:()=>g(e),children:t.jsx("div",{className:"thumb",children:t.jsx("img",{src:e.frontimage,alt:e.title,loading:"lazy"})})},e._id))}),c&&t.jsxs("div",{className:"loading",children:[t.jsx("div",{className:"spinner"})," جارٍ تحميل المزيد…"]}),!c&&l.length===0&&t.jsx("div",{className:"empty",children:"لا توجد بيانات متاحة"})]})}export{A 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.