PageSourceSearch

https://taxease360.ai/assets/DocumentLibrary-CET0IOPE.js

js taxease360.ai collected 2026-10-05 14:25:54 UTC 6,427 bytes, 1 lines download raw bytes

1import{r as n,j as e,q as R,L as k,D,A,i as L,I as z,F as h,C as T,a1 as P,p as r}from"./index-CfXbMZ_V.js";import{P as E}from"./PortalHeader-BREe-gcq.js";import{C as q}from"./clock-DmU1_sat.js";import{D as H}from"./download-oHmw96Dk.js";import"./chevron-left-BFeklwt6.js";const p=["Tax Returns","Tax Receipts","Work Related Expenses","Rental Property Documents","Business Documents","ID Documents","AML Documents","Bank Statements","Logbook Records","Other"],I={"Pending Review":"bg-amber-100 text-amber-700",Approved:"bg-green-100 text-green-700",Rejected:"bg-red-100 text-red-700","Needs Resubmission":"bg-orange-100 text-orange-700"};function G(){const[O,f]=n.useState(null),[i,o]=n.useState([]),[j,b]=n.useState(!0),[d,N]=n.useState("All"),[c,y]=n.useState(""),[m,v]=n.useState([]);n.useEffect(()=>{(async()=>{const s=await r.auth.me();let a=await r.entities.Client.filter({user_id:s.id});a.length===0&&(a=[await r.entities.Client.create({user_id:s.id,full_name:s.full_name||s.email,email:s.email,status:"New Client"})]),f(a[0]);const S=await r.entities.Document.filter({client_id:a[0].id});o(S);const _=await r.entities.SignatureRequest.filter({client_id:a[0].id},"-requested_date",300);v(_),b(!1)})()},[]);const w=t=>{o(s=>s.filter(a=>a.id!==t)),r.entities.Document.delete(t)},x=i.filter(t=>{const s=d==="All"||t.category===d,a=!c||(t.file_name||"").toLowerCase().includes(c.toLowerCase());return s&&a}),u=p.reduce((t,s)=>(t[s]=i.filter(a=>a.category===s).length,t),{}),l=m.filter(t=>t.status==="pending"),g=new Set(m.filter(t=>t.signed_document_url).map(t=>t.signed_document_url)),C=i.filter(t=>g.has(t.file_url)).length;return j?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(R,{className:"w-8 h-8 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"space-y-5 pb-10",children:[e.jsx(E,{title:"Document Library",subtitle:"View, download & manage your documents",backTo:"/portal"}),e.jsxs("div",{className:"bg-gradient-to-r from-primary to-secondary rounded-2xl p-5 text-white",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide opacity-80",children:"Total Documents"}),e.jsx("p",{className:"text-3xl font-bold mt-1",children:i.length}),e.jsxs("div",{className:"grid grid-cols-4 gap-2 mt-4",children:[e.jsxs("div",{className:"bg-white/15 rounded-xl p-3 text-center",children:[e.jsx("p",{className:"text-white font-bold",children:C}),e.jsx("p",{className:"text-xs opacity-80",children:"Signed"})]}),e.jsxs("div",{className:"bg-white/15 rounded-xl p-3 text-center",children:[e.jsx("p",{className:"text-white font-bold",children:i.filter(t=>t.status==="Approved").length}),e.jsx("p",{className:"text-xs opacity-80",children:"Approved"})]}),e.jsxs("div",{className:"bg-white/15 rounded-xl p-3 text-center",children:[e.jsx("p",{className:"text-white font-bold",children:i.filter(t=>t.status==="Pending Review").length}),e.jsx("p",{className:"text-xs opacity-80",children:"Pending"})]}),e.jsxs("div",{className:"bg-white/15 rounded-xl p-3 text-center",children:[e.jsx("p",{className:"text-white font-bold",children:i.filter(t=>t.status==="Needs Resubmission").length}),e.jsx("p",{className:"text-xs opacity-80",children:"Resubmit"})]})]})]}),l.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(q,{size:16,className:"text-amber-600"}),e.jsxs("p",{className:"text-sm font-semibold text-amber-800",children:[l.length," document",l.length>1?"s":""," waiting for your signature"]})]}),e.jsx("div",{className:"space-y-1.5",children:l.map(t=>e.jsxs(k,{to:`/sign/${t.token}`,className:"flex items-center justify-between bg-white border border-amber-100 rounded-lg px-3 py-2.5",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-800 truncate flex-1 flex items-center gap-2",children:[e.jsx(D,{size:14,className:"text-amber-600 shrink-0"})," ",t.title]}),e.jsxs("span",{className:"text-xs text-amber-700 font-medium flex items-center gap-1 shrink-0 ml-2",children:["Sign ",e.jsx(A,{size:12})]})]},t.id))})]}),e.jsxs("div",{className:"relative",children:[e.jsx(L,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.jsx(z,{placeholder:"Search documents",value:c,onChange:t=>y(t.target.value),className:"pl-9"})]}),e.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:["All",...p].map(t=>e.jsxs("button",{onClick:()=>N(t),className:`shrink-0 px-3 py-1.5 rounded-full text-xs font-medium transition-colors ${d===t?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:{minHeight:36},children:[t,t!=="All"&&u[t]?` (${u[t]})`:""]},t))}),x.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(h,{size:40,className:"mx-auto mb-2 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No documents found"})]}):e.jsx("div",{className:"space-y-2",children:x.map(t=>e.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-lg flex items-center justify-center shrink-0",children:e.jsx(h,{size:18,className:"text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:t.file_name}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[t.category," • ",t.upload_date]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-1",children:[g.has(t.file_url)&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium text-emerald-700 bg-emerald-50 px-2 py-0.5 rounded-full",children:[e.jsx(T,{size:11})," Signed"]}),e.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${I[t.status]||"bg-gray-100 text-gray-500"}`,children:t.status}),e.jsxs("div",{className:"flex gap-1",children:[t.file_url&&e.jsx("a",{href:t.file_url,target:"_blank",rel:"noreferrer",download:!0,className:"flex items-center justify-center rounded hover:bg-muted text-muted-foreground hover:text-primary",style:{minHeight:36,minWidth:36},children:e.jsx(H,{size:14})}),e.jsx("button",{onClick:()=>w(t.id),className:"flex items-center justify-center rounded hover:bg-red-50 text-muted-foreground hover:text-red-500",style:{minHeight:36,minWidth:36},children:e.jsx(P,{size:14})})]})]})]},t.id))})]})}export{G 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.