This repository has been archived on 2026-07-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cloud-reader/frontend/dist/assets/Library-Ci_rxC-B.js
T
crisleo94 6b4c0c43f8 feat: uv config other feats
- add uv configuration for the backend
- update frontend to make auth work
- add new auth endpoints
- add bookmars feat
- add reader feat
2026-06-03 22:06:01 -05:00

2 lines
19 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{r,X as O,h as V,j as e,k as ce,e as de,d as ue}from"./index-BQiEVoRj.js";import{b as P}from"./books-BG7wMiRx.js";import{u as ge,B as fe}from"./useMediaQuery-DwhAHSnz.js";import{g as K}from"./errors-bLl0IgZb.js";const pe=99;function he(s,o=!1){return s!=null&&s>=pe?"finished":s!=null&&s>0?"reading":o?"opened":"want_to_read"}function me(s){if(s==null)return null;const o=Math.round(s);return o<=0?null:Math.min(100,o)}function J(s,o){const[n,h]=r.useState(s);return r.useEffect(()=>{const v=setTimeout(()=>h(s),o);return()=>clearTimeout(v)},[s,o]),n}function xe(){const[s,o]=r.useState(!1),[n,h]=r.useState(""),[v,k]=r.useState(!1),[c,m]=r.useState(!1),[j,S]=r.useState(null),y=r.useRef(null),d=r.useRef(!0);r.useEffect(()=>{d.current=!0;const E=window.SpeechRecognition??window.webkitSpeechRecognition;if(typeof E=="function"){k(!0);const _=new E;_.continuous=!1,_.interimResults=!1,_.lang="en-US",_.onresult=g=>{var C,R;const f=((R=(C=g.results[0])==null?void 0:C[0])==null?void 0:R.transcript)??"";d.current&&(h(f),m(!1),S(null))},_.onerror=g=>{d.current&&(m(!0),S(g.error),o(!1))},_.onend=()=>{d.current&&o(!1)},y.current=_}return()=>{d.current=!1,y.current&&y.current.abort()}},[]);const a=r.useCallback(()=>{if(y.current){h(""),m(!1),S(null);try{y.current.start(),o(!0)}catch{o(!1)}}},[]),l=r.useCallback(()=>{y.current&&(y.current.stop(),o(!1))},[]);return{isListening:s,transcript:n,isSupported:v,hasError:c,errorMessage:j,startListening:a,stopListening:l}}const be="_container_1fxkh_1",ye="_infoText_1fxkh_31",ve="_suggestionItem_1fxkh_43",Se="_coverImage_1fxkh_71",ke="_coverPlaceholder_1fxkh_85",je="_bookInfo_1fxkh_95",_e="_bookTitle_1fxkh_103",we="_bookAuthor_1fxkh_121",L={container:be,infoText:ye,suggestionItem:ve,coverImage:Se,coverPlaceholder:ke,bookInfo:je,bookTitle:_e,bookAuthor:we};function Ce({query:s,visible:o,onClose:n,onSelectSuggestion:h}){const{t:v}=O(),k=V(),[c,m]=r.useState([]),[j,S]=r.useState(!1),y=r.useRef(null),d=J(s,200);return r.useEffect(()=>{if(!d.trim()){m([]);return}let a=!1;return S(!0),P.searchBooks({q:d.trim(),page_size:5}).then(l=>{a||(m(l.results),S(!1))},()=>{a||(m([]),S(!1))}),()=>{a=!0}},[d]),r.useEffect(()=>{if(!o)return;const a=E=>{y.current&&!y.current.contains(E.target)&&n()},l=setTimeout(()=>document.addEventListener("click",a),0);return()=>{clearTimeout(l),document.removeEventListener("click",a)}},[o,n]),r.useEffect(()=>{if(!o)return;const a=l=>{l.key==="Escape"&&n()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[o,n]),!o||!s.trim()?null:e.jsxs("div",{ref:y,className:L.container,children:[j&&e.jsx("div",{className:L.infoText,children:v("search.searching")}),!j&&c.length===0&&d.trim()&&e.jsx("div",{className:L.infoText,children:v("search.noSuggestions")}),c.map(a=>e.jsxs("div",{className:L.suggestionItem,onClick:()=>{h(),k(`/books/${a.id}`)},children:[e.jsx("span",{className:L.coverPlaceholder,children:a.cover_image?e.jsx("img",{src:a.cover_image,alt:"",className:L.coverImage}):"📖"}),e.jsxs("div",{className:L.bookInfo,children:[e.jsx("div",{className:L.bookTitle,children:a.title}),e.jsx("div",{className:L.bookAuthor,children:a.author||v("common.unknownAuthor")})]})]},a.id))]})}const Re="_menu_ekpcj_1",Ee="_item_ekpcj_25",Le="_itemDanger_ekpcj_69",Be="_itemLoading_ekpcj_85",ze="_separator_ekpcj_93",B={menu:Re,item:Ee,itemDanger:Le,itemLoading:Be,separator:ze};function Pe(s,o,n,h){const k=window.innerWidth-n-8,c=window.innerHeight-h-8;return{left:Math.max(8,Math.min(s,k)),top:Math.max(8,Math.min(o,c))}}function Te({book:s,x:o,y:n,onClose:h,onBookUpdated:v,onBookRemoved:k}){const{t:c}=O(),{showToast:m}=ce(),j=r.useRef(null),[S,y]=r.useState({left:o,top:n}),[d,a]=r.useState(null);r.useLayoutEffect(()=>{const g=j.current;g&&y(Pe(o,n,g.offsetWidth,g.offsetHeight))},[o,n]),r.useEffect(()=>{const g=R=>{j.current&&!j.current.contains(R.target)&&h()},f=R=>{R.key==="Escape"&&h()},C=()=>h();return document.addEventListener("mousedown",g),document.addEventListener("keydown",f),window.addEventListener("scroll",C,!0),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",f),window.removeEventListener("scroll",C,!0)}},[h]);const l=async()=>{var g;a("sync");try{const f=await P.enrichEBookMetadata(s.id);v({...s,id:f.id,title:f.title,author:f.author,genre:f.format?f.format.toUpperCase():"",format:f.format,cover_image:f.cover_image,progressPercent:s.progressPercent});const C=(g=f.metadata)==null?void 0:g.match_status;m(C==="matched"?{message:c("toast.metadataSynced",{title:f.title}),variant:"success"}:C==="not_found"?{message:c("toast.noMatch"),variant:"warning"}:{message:c("toast.refreshDone"),variant:"success"})}catch(f){m({message:K(f,c("common.unknownError")),variant:"error"})}finally{a(null),h()}},E=async()=>{if(window.confirm(c("contextMenu.confirmRemove",{title:s.title}))){a("remove");try{await P.deleteEBook(s.id),k(s.id),m({message:c("toast.removed",{title:s.title}),variant:"success"})}catch(f){m({message:K(f,c("common.unknownError")),variant:"error"})}finally{a(null),h()}}},_=d!==null;return e.jsxs("div",{ref:j,className:B.menu,style:{left:S.left,top:S.top},role:"menu",onClick:g=>g.stopPropagation(),onContextMenu:g=>g.preventDefault(),children:[e.jsx("button",{type:"button",className:`${B.item} ${d==="sync"?B.itemLoading:""}`,role:"menuitem",disabled:_,onClick:()=>void l(),children:c(d==="sync"?"contextMenu.syncingMetadata":"contextMenu.syncMetadata")}),e.jsx("div",{className:B.separator,role:"separator"}),e.jsx("button",{type:"button",className:`${B.item} ${B.itemDanger} ${d==="remove"?B.itemLoading:""}`,role:"menuitem",disabled:_,onClick:()=>void E(),children:c(d==="remove"?"contextMenu.removing":"contextMenu.remove")})]})}const Me="_bookCard_11p5a_1",Ne="_coverProgressBar_11p5a_29",Ie="_coverProgressFill_11p5a_47",$={bookCard:Me,coverProgressBar:Ne,coverProgressFill:Ie};function X(s,o){return s.reading_status==="reading"&&s.progressPercent!=null?o("library.readingStatus.readingWithProgress",{percent:String(s.progressPercent)}):o(ue(s.reading_status))}const z={minHeight:44,minWidth:44,display:"inline-flex",alignItems:"center",justifyContent:"center"};function De(){const s=V(),{logout:o}=de(),{t:n}=O(),[h,v]=r.useState([]),[k,c]=r.useState(!0),[m,j]=r.useState(null),[S,y]=r.useState(null),[d,a]=r.useState(""),[l,E]=r.useState({genre:"",author:"",reading_status:""}),[_,g]=r.useState([]),[f,C]=r.useState([]),[R,F]=r.useState(0),[N,U]=r.useState(!1),[Z,T]=r.useState(!1),[I,G]=r.useState(null),W=J(d,300),q=r.useRef(!1),ee=r.useRef(null),i=ge(fe.md),u=xe();r.useEffect(()=>{u.transcript&&!u.isListening&&(a(u.transcript),T(!1))},[u.transcript,u.isListening]),r.useEffect(()=>{q.current||(q.current=!0,Promise.all([P.getGenres(),P.getAuthors()]).then(([t,b])=>{g(t),C(b)},()=>{}))},[]);const H=r.useCallback(async t=>{var b;c(!0),j(null);try{let w=(await P.getEBooks()).map(p=>{const le=me(p.progress),Y=he(p.progress,!!p.opened);return{id:p.id,title:p.title,author:p.author,genre:p.format?p.format.toUpperCase():"",format:p.format,reading_status:Y,reading_status_display:Y,cover_image:p.cover_image,progressPercent:le}});const A=(b=t.q)==null?void 0:b.trim().toLowerCase();A&&(w=w.filter(p=>p.title.toLowerCase().includes(A)||p.author.toLowerCase().includes(A)||p.genre.toLowerCase().includes(A))),t.author&&(w=w.filter(p=>p.author===t.author)),t.genre&&(w=w.filter(p=>p.genre===t.genre)),t.reading_status&&(w=w.filter(p=>p.reading_status===t.reading_status)),v(w),F(w.length)}catch(x){j(x instanceof Error?x.message:n("library.loadFailed")),v([]),F(0)}finally{c(!1)}},[n]),te=[{value:"",label:n("library.allStatuses")},{value:"want_to_read",label:n("library.readingStatus.wantToRead")},{value:"opened",label:n("library.readingStatus.opened")},{value:"reading",label:n("library.readingStatus.reading")},{value:"finished",label:n("library.readingStatus.finished")},{value:"dnf",label:n("library.readingStatus.dnf")}];r.useEffect(()=>{const t={};W&&(t.q=W),l.genre&&(t.genre=l.genre),l.author&&(t.author=l.author),l.reading_status&&(t.reading_status=l.reading_status),H(t)},[W,l,H]);const D=(t,b)=>{E(x=>({...x,[t]:b}))},Q=()=>{a(""),E({genre:"",author:"",reading_status:""}),U(!1)},M=!!d||!!l.genre||!!l.author||!!l.reading_status,ne=r.useCallback(t=>{v(b=>b.map(x=>x.id===t.id?{...x,...t,progressPercent:t.progressPercent??x.progressPercent,reading_status:t.reading_status??x.reading_status}:x))},[]),re=r.useCallback(t=>{v(b=>b.filter(x=>x.id!==t)),F(b=>Math.max(0,b-1))},[]),se=r.useCallback((t,b)=>{t.preventDefault(),t.stopPropagation(),G({book:b,x:t.clientX,y:t.clientY})},[]),ie={maxWidth:960,margin:"0 auto",padding:i?12:16,minHeight:"100vh",background:"#f8f9fa"},oe={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:i?12:20,padding:i?"12px 0":"16px 0",borderBottom:"1px solid #e5e7eb",flexWrap:"wrap",gap:8},ae={position:"relative",flex:1};return e.jsxs("div",{style:ie,children:[e.jsxs("header",{style:oe,children:[e.jsxs("div",{children:[e.jsx("h1",{style:{fontSize:i?20:24,fontWeight:700,color:"#1f2937",margin:0},children:n("library.title")}),!k&&e.jsx("p",{style:{fontSize:13,color:"#6b7280",marginTop:2},children:R===1?n("library.bookCountOne",{count:String(R)}):n("library.bookCountMany",{count:String(R)})})]}),e.jsx("div",{style:{display:"flex",gap:i?4:8,flexWrap:"wrap",alignItems:"center"},children:i?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>s("/add"),style:{...z,fontSize:20,background:"none",border:"none",cursor:"pointer",padding:8},title:n("library.addBook"),children:""}),e.jsx("button",{onClick:()=>s("/bookmarks-notes"),style:{...z,fontSize:20,background:"none",border:"none",cursor:"pointer",padding:8},title:n("library.bookmarks"),children:"🔖"}),e.jsx("button",{onClick:()=>s("/settings"),style:{...z,fontSize:20,background:"none",border:"none",cursor:"pointer",padding:8},title:n("library.settings"),children:"⚙️"}),e.jsx("button",{onClick:o,style:{...z,fontSize:20,background:"none",border:"none",cursor:"pointer",padding:8},title:n("library.logout"),children:"🚪"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>s("/add"),className:"btn",children:["+ ",n("library.addBook")]}),e.jsx("button",{onClick:()=>s("/bookmarks-notes"),className:"btn btn-secondary",children:n("library.bookmarks")}),e.jsx("button",{onClick:()=>s("/settings"),className:"btn btn-secondary",children:n("library.settings")}),e.jsx("button",{onClick:o,className:"btn btn-danger",children:n("library.logout")})]})})]}),e.jsx("div",{style:{marginBottom:16},children:e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[e.jsxs("div",{style:ae,children:[e.jsx("input",{ref:ee,type:"text",placeholder:n("library.searchPlaceholder"),value:d,onChange:t=>{a(t.target.value),T(!0)},onFocus:()=>T(!0),style:{width:"100%",padding:`12px 16px 12px ${u.isSupported,44}px`,paddingRight:u.isSupported?48:16,borderRadius:10,border:"1px solid #e5e7eb",fontSize:i?16:15,background:"#fff",outline:"none",boxSizing:"border-box",minHeight:44}}),e.jsx("span",{style:{position:"absolute",left:14,top:"50%",transform:"translateY(-50%)",fontSize:18,color:"#9ca3af",pointerEvents:"none"},children:"🔍"}),u.isSupported&&e.jsx("button",{onClick:()=>{u.isListening?u.stopListening():u.startListening()},style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",background:u.isListening?"#dc2626":"transparent",border:"none",borderRadius:8,cursor:"pointer",fontSize:20,padding:"8px 8px",minWidth:36,minHeight:36,display:"flex",alignItems:"center",justifyContent:"center",color:u.isListening?"#fff":"#6b7280",transition:"background 0.15s"},title:u.isListening?n("library.voiceSearchStopTitle"):n("library.voiceSearchTitle"),children:"🎤"}),e.jsx(Ce,{query:d,visible:Z&&!u.isListening,onClose:()=>T(!1),onSelectSuggestion:()=>T(!1)})]}),e.jsx("button",{onClick:()=>U(!N),style:{...z,padding:"0 12px",borderRadius:8,border:"1px solid #e5e7eb",background:N?"#4f46e5":"#fff",color:N?"#fff":"#374151",fontSize:13,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",gap:4},children:i?"⚙️":`▼ ${n("library.filtersLabel")}`})]})}),u.isListening&&e.jsxs("div",{style:{background:"#fef2f2",padding:"10px 16px",borderRadius:8,marginBottom:12,display:"flex",alignItems:"center",gap:8,fontSize:14,color:"#dc2626"},children:[e.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:"#dc2626",animation:"pulse 1s infinite"}}),n("library.listening"),e.jsx("button",{onClick:u.stopListening,style:{marginLeft:"auto",background:"#dc2626",color:"#fff",border:"none",borderRadius:4,padding:"4px 12px",cursor:"pointer",fontSize:12},children:n("library.stop")})]}),u.hasError&&!u.isListening&&e.jsx("div",{style:{background:"#fef3c7",padding:"8px 12px",borderRadius:8,marginBottom:12,fontSize:13,color:"#92400e"},children:u.errorMessage==="no-speech"?n("library.voiceNoSpeech"):n("library.voiceError",{message:u.errorMessage??""})}),N&&e.jsxs("div",{style:{background:"#fff",borderRadius:10,padding:i?12:16,marginBottom:16,border:"1px solid #e5e7eb",display:"flex",flexDirection:i?"column":"row",gap:12,alignItems:i?"stretch":"end"},children:[e.jsxs("div",{style:{minWidth:i?0:160,flex:1},children:[e.jsx("label",{style:{display:"block",fontSize:12,fontWeight:600,color:"#6b7280",marginBottom:4},children:n("library.genre")}),e.jsxs("select",{value:l.genre,onChange:t=>D("genre",t.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:6,border:"1px solid #e5e7eb",fontSize:14,background:"#fff",cursor:"pointer",minHeight:36},children:[e.jsx("option",{value:"",children:n("library.allGenres")}),_.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{style:{minWidth:i?0:160,flex:1},children:[e.jsx("label",{style:{display:"block",fontSize:12,fontWeight:600,color:"#6b7280",marginBottom:4},children:n("library.author")}),e.jsxs("select",{value:l.author,onChange:t=>D("author",t.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:6,border:"1px solid #e5e7eb",fontSize:14,background:"#fff",cursor:"pointer",minHeight:36},children:[e.jsx("option",{value:"",children:n("library.allAuthors")}),f.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{style:{minWidth:i?0:160,flex:1},children:[e.jsx("label",{style:{display:"block",fontSize:12,fontWeight:600,color:"#6b7280",marginBottom:4},children:n("library.status")}),e.jsx("select",{value:l.reading_status,onChange:t=>D("reading_status",t.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:6,border:"1px solid #e5e7eb",fontSize:14,background:"#fff",cursor:"pointer",minHeight:36},children:te.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]}),M&&e.jsxs("button",{onClick:Q,style:{...z,padding:"8px 16px",borderRadius:6,border:"1px solid #e5e7eb",background:"#fff",color:"#6b7280",fontSize:13,cursor:"pointer",whiteSpace:"nowrap",width:i?"100%":"auto"},children:["✕ ",n("library.clearFilters")]})]}),m&&e.jsxs("div",{style:{background:"#fef2f2",padding:16,borderRadius:8,marginBottom:16,textAlign:"center"},children:[e.jsx("p",{style:{color:"#dc2626",fontSize:14},children:m}),e.jsx("button",{onClick:()=>void H({}),style:{marginTop:8,padding:"8px 16px",border:"none",borderRadius:6,background:"#dc2626",color:"#fff",cursor:"pointer",fontSize:13,minHeight:36},children:n("common.retry")})]}),S&&e.jsxs("div",{style:{background:"#fffbeb",border:"1px solid #fde68a",borderRadius:8,padding:"12px 16px",marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[e.jsx("p",{style:{color:"#92400e",fontSize:14,margin:0},children:S}),e.jsx("button",{type:"button",onClick:()=>y(null),style:{padding:"4px 10px",border:"none",borderRadius:6,background:"#f59e0b",color:"#fff",cursor:"pointer",fontSize:12,flexShrink:0},children:n("common.dismiss")})]}),k&&e.jsx("div",{style:{display:"grid",gridTemplateColumns:i?"1fr":"repeat(auto-fill, minmax(200px, 1fr))",gap:i?12:16,opacity:.6},children:Array.from({length:i?4:8}).map((t,b)=>e.jsxs("div",{style:{background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 2px 8px rgba(0,0,0,0.06)",display:i?"flex":"block"},children:[e.jsx("div",{style:{width:i?80:"100%",height:i?120:180,background:"#f0f0f0",flexShrink:0}}),e.jsxs("div",{style:{padding:12},children:[e.jsx("div",{style:{height:14,background:"#f0f0f0",borderRadius:4,marginBottom:6,width:"70%"}}),e.jsx("div",{style:{height:12,background:"#f0f0f0",borderRadius:4,width:"40%"}})]})]},b))}),!k&&!m&&h.length===0&&e.jsxs("div",{style:{textAlign:"center",padding:i?"60px 16px":"80px 20px"},children:[e.jsx("div",{style:{fontSize:i?48:64,marginBottom:16},children:M?"🔍":"📚"}),e.jsx("h2",{style:{fontSize:i?18:20,color:"#1f2937",marginBottom:8},children:n(M?"library.emptyFilteredTitle":"library.emptyTitle")}),e.jsx("p",{style:{color:"#6b7280",marginBottom:20,fontSize:15,lineHeight:1.5},children:n(M?"library.emptyFilteredDescription":"library.emptyDescription")}),M?e.jsx("button",{onClick:Q,className:"btn",style:{padding:"12px 24px",fontSize:15,minHeight:44},children:n("library.clearAllFilters")}):e.jsx("button",{onClick:()=>s("/add"),className:"btn",style:{padding:"12px 24px",fontSize:15,minHeight:44},children:n("library.addFirstBook")})]}),!k&&h.length>0&&e.jsx("div",{style:{display:"grid",gridTemplateColumns:i?"1fr":"repeat(auto-fill, minmax(200px, 1fr))",gap:i?12:16},children:h.map(t=>{const x={want_to_read:{bg:"#dbeafe",text:"#1d4ed8"},opened:{bg:"#e0f2fe",text:"#0369a1"},reading:{bg:"#dcfce7",text:"#16a34a"},finished:{bg:"#f3e8ff",text:"#9333ea"},dnf:{bg:"#fef3c7",text:"#b45309"}}[t.reading_status]??{bg:"#f3f4f6",text:"#6b7280"};return e.jsxs("div",{onClick:()=>{if(t.format==="pdf"){y(n("library.pdfNotice"));return}s(`/read/${t.id}`)},onContextMenu:w=>se(w,t),className:$.bookCard,style:{display:i?"flex":"block"},children:[e.jsxs("div",{style:{width:i?80:"100%",height:i?120:180,background:"#f0f0f0",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",flexShrink:0},children:[t.cover_image?e.jsx("img",{src:t.cover_image,alt:t.title,style:{width:"100%",height:"100%",objectFit:"cover"}}):e.jsx("span",{style:{fontSize:i?32:48},children:"📖"}),t.reading_status==="reading"&&t.progressPercent!=null&&e.jsx("div",{className:$.coverProgressBar,children:e.jsx("div",{className:$.coverProgressFill,style:{width:`${t.progressPercent}%`}})}),!i&&e.jsx("span",{style:{position:"absolute",top:8,right:8,background:x.bg,color:x.text,fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:999,lineHeight:"18px"},children:X(t,n)})]}),e.jsxs("div",{style:{padding:i?"8px 12px":12,flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8},children:[e.jsxs("div",{style:{minWidth:0,flex:1},children:[e.jsx("h3",{style:{fontSize:14,fontWeight:600,color:"#1f2937",marginBottom:2,margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.title}),e.jsx("p",{style:{fontSize:12,color:"#6b7280",marginBottom:4,margin:"2px 0"},children:t.author||n("common.unknownAuthor")})]}),i&&e.jsx("span",{style:{background:x.bg,color:x.text,fontSize:10,fontWeight:600,padding:"2px 6px",borderRadius:999,whiteSpace:"nowrap",flexShrink:0},children:X(t,n)})]}),t.genre&&e.jsx("span",{style:{fontSize:11,color:"#4f46e5",background:"#eef2ff",padding:"1px 6px",borderRadius:4,display:"inline-block",marginTop:4},children:t.genre})]})]},t.id)})}),I&&e.jsx(Te,{book:I.book,x:I.x,y:I.y,onClose:()=>G(null),onBookUpdated:ne,onBookRemoved:re})]})}export{De as LibraryPage};