PageSourceSearch

https://soulmessages-lab.lovable.app/assets/app.library-CC-fKI_W.js

js soulmessages-lab.lovable.app collected 2026-10-03 03:45:42 UTC 2,747 bytes, 1 lines download raw bytes

1import{l as h,t as r,j as e,L as f}from"./index-Co_COyci.js";import{u as o}from"./useServerFn-BKNxTzPx.js";import{u as j}from"./useQuery-DqEksgYJ.js";import{u as y}from"./useMutation-IQ10GMxH.js";import{l as g,g as N,d as v}from"./documents.functions-C1H5P5OV.js";import{C as m}from"./card-cZcrpr2o.js";import{B as n}from"./button-BPDTLcKN.js";import{A as w}from"./arrow-left-B4z9jhh9.js";import{F as D}from"./file-text-YA-OO-sx.js";import{D as C}from"./download-DOXtGI-v.js";import{T as F}from"./trash-2-C6XyTZOF.js";import"./auth-middleware-Bw-vsZYX.js";import"./utils-BQHNewu7.js";import"./index-BVi1qgC0.js";import"./index-LHNt3CwB.js";import"./createLucideIcon-D9X7GujO.js";function U(){const c=o(g),l=o(N),d=o(v),u=h(),{data:a,isLoading:i}=j({queryKey:["user-documents"],queryFn:async()=>await c()}),x=y({mutationFn:async s=>await d({data:{documentId:s}}),onSuccess:()=>{r.success("Removed"),u.invalidateQueries({queryKey:["user-documents"]})},onError:s=>r.error(s.message||"Could not delete document")}),p=async s=>{try{const{url:t}=await l({data:{documentId:s}});window.open(t,"_blank","noopener")}catch{r.error("Could not open file")}};return e.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx(n,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(f,{to:"/app",children:e.jsx(w,{className:"w-4 h-4"})})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Your Library"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"All the PDFs you've saved from your conversations."})]})]}),i&&e.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"}),!i&&(!a||a.length===0)&&e.jsxs(m,{className:"p-8 text-center text-muted-foreground",children:[e.jsx(D,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No documents yet. Save a chat output as PDF and it will appear here."})]}),e.jsx("div",{className:"space-y-2",children:a?.map(s=>{const t=s.gpts;return e.jsxs(m,{className:"p-4 flex items-center gap-3",children:[e.jsx("span",{className:"text-2xl",children:t?.icon??"📄"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t?.name?`${t.name} · `:"",new Date(s.created_at).toLocaleString()," ·"," ",Math.max(1,Math.round(s.size_bytes/1024))," KB"]})]}),e.jsx(n,{variant:"ghost",size:"sm",onClick:()=>p(s.id),children:e.jsx(C,{className:"w-4 h-4"})}),e.jsx(n,{variant:"ghost",size:"sm",onClick:()=>{confirm("Delete this PDF?")&&x.mutate(s.id)},children:e.jsx(F,{className:"w-4 h-4 text-destructive"})})]},s.id)})})]})}export{U as component};

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.