PageSourceSearch

https://mysendbit.com/assets/EvidenceRequestsPage-B4Fp4pqU.js

js mysendbit.com collected 2026-10-02 00:53:49 UTC 6,173 bytes, 1 lines download raw bytes

1import{h as P,r as n,j as e}from"./vendor-react-Dw7X3JZT.js";import{b as A}from"./vendor-utils-WadUx6vN.js";import{an as E,B as h,C as c,p as d,S as f,x as b,y as N,z as y,E as l}from"./index-BEZ7mpN6.js";import{S as p}from"./skeleton-BvL8Xyo9.js";import{T as I,a as O,b as L}from"./tabs-CRShrmdz.js";import{e as F,a as U,b as V,f as $}from"./evidence-utils-BOdi06X0.js";import{u as z,i as B,F as M,d as w,c as D}from"./vendor-ui-ODtAki8E.js";import"./vendor-CZR7Gm73.js";import"./vendor-framer-motion-CpxrKHsN.js";const K=[{value:"action_required",label:"Action Required"},{value:"waiting",label:"Waiting"},{value:"completed",label:"Completed"}],Q={action_required:[{value:"requested",label:"Requested"},{value:"more_information_required",label:"More information required"}],waiting:[{value:"submitted",label:"Submitted"},{value:"under_review",label:"Under review"}],completed:[{value:"accepted",label:"Accepted"},{value:"rejected",label:"Rejected"}]},ae=()=>{const S=P(),[t,_]=n.useState("action_required"),[o,C]=n.useState("all"),[m,j]=n.useState("all"),[q,k]=n.useState({action_required:1,waiting:1,completed:1}),i=q[t],v=n.useMemo(()=>({section:t,page:i,per_page:10,...o!=="all"?{service:o}:{},...m!=="all"?{status:m}:{}}),[i,t,o,m]),{data:a,isLoading:R,isFetching:x,error:T,refetch:g}=A({queryKey:["evidence-requests",v],queryFn:()=>E.list(v)}),u=s=>{k(r=>({...r,[t]:Math.max(1,s)}))};return e.jsxs("div",{className:"container max-w-6xl space-y-6 py-2",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Evidence Requests"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Review and respond to transaction evidence requested by SendBit."})]}),e.jsxs(h,{type:"button",variant:"outline",onClick:()=>g(),disabled:x,children:[e.jsx(z,{className:`mr-2 h-4 w-4 ${x?"animate-spin":""}`}),"Refresh"]})]}),e.jsx(c,{children:e.jsxs(d,{className:"space-y-5 p-4 sm:p-6",children:[e.jsx(I,{value:t,onValueChange:s=>{_(s),j("all")},children:e.jsx(O,{className:"grid h-auto w-full grid-cols-3",children:K.map(s=>e.jsx(L,{value:s.value,className:"px-2 py-2 text-xs sm:text-sm",children:s.label},s.value))})}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs(f,{value:o,onValueChange:s=>{C(s),u(1)},children:[e.jsx(b,{className:"border",children:e.jsx(N,{placeholder:"All services"})}),e.jsxs(y,{children:[e.jsx(l,{value:"all",children:"All services"}),e.jsx(l,{value:"payment_links",children:"Payment Links"}),e.jsx(l,{value:"invoices",children:"Invoices"}),e.jsx(l,{value:"paypal",children:"PayPal"}),e.jsx(l,{value:"other",children:"Other"})]})]}),e.jsxs(f,{value:m,onValueChange:s=>{j(s),u(1)},children:[e.jsx(b,{className:"border",children:e.jsx(N,{placeholder:"All statuses"})}),e.jsxs(y,{children:[e.jsx(l,{value:"all",children:"All statuses"}),Q[t].map(s=>e.jsx(l,{value:s.value,children:s.label},s.value))]})]})]})]})}),e.jsx("div",{className:"space-y-3","aria-live":"polite",children:R?Array.from({length:4}).map((s,r)=>e.jsx(c,{children:e.jsxs(d,{className:"space-y-3 p-5",children:[e.jsx(p,{className:"h-5 w-48"}),e.jsx(p,{className:"h-4 w-full"}),e.jsx(p,{className:"h-4 w-2/3"})]})},r)):T?e.jsx(c,{className:"border-red-200 bg-red-50",children:e.jsxs(d,{className:"flex flex-col items-center py-10 text-center",children:[e.jsx(B,{className:"mb-3 h-8 w-8 text-red-600"}),e.jsx("h2",{className:"font-semibold text-red-900",children:"Unable to load evidence requests"}),e.jsx("p",{className:"mt-1 text-sm text-red-700",children:"Please try again without losing your current filters."}),e.jsx(h,{type:"button",className:"mt-4",onClick:()=>g(),children:"Try again"})]})}):a?.items.length?a.items.map(s=>{const r=F(s,a.server_time);return e.jsx("button",{type:"button",onClick:()=>S(`/dashboard/evidence-requests/${encodeURIComponent(s.reference)}`),className:"block w-full rounded-xl text-left focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:e.jsx(c,{className:`transition-colors hover:border-primary/40 ${r?"border-red-300":""}`,children:e.jsx(d,{className:"p-4 sm:p-5",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h2",{className:"font-semibold text-gray-900",children:s.category_label}),e.jsx("span",{className:`rounded-full px-2.5 py-1 text-xs font-medium ${U(s.status)}`,children:s.status_label}),r&&e.jsx("span",{className:"rounded-full bg-red-100 px-2.5 py-1 text-xs font-semibold text-red-700",children:"Overdue"})]}),e.jsx("p",{className:"mt-2 line-clamp-3 text-sm leading-6 text-gray-600",children:s.request_message}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[e.jsx("span",{children:V(s.service)}),e.jsx("span",{children:s.subject_reference}),e.jsxs("span",{children:["Due ",$(s.due_at)]})]})]}),e.jsx(w,{className:"hidden h-5 w-5 shrink-0 text-gray-400 sm:block"})]})})})},s.reference)}):e.jsx(c,{children:e.jsxs(d,{className:"flex flex-col items-center py-12 text-center",children:[e.jsx(M,{className:"mb-3 h-10 w-10 text-primary"}),e.jsx("h2",{className:"font-semibold text-gray-900",children:"No evidence requests in this section"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"New requests will appear here when available."})]})})}),a?.pagination&&a.pagination.last_page>1&&e.jsxs("div",{className:"flex items-center justify-between rounded-lg border bg-white p-3",children:[e.jsxs(h,{type:"button",variant:"outline",size:"sm",onClick:()=>
1u(i-1),disabled:i<=1||x,children:[e.jsx(D,{className:"mr-1 h-4 w-4"})," Previous"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",a.pagination.current_page," of ",a.pagination.last_page]}),e.jsxs(h,{type:"button",variant:"outline",size:"sm",onClick:()=>u(i+1),disabled:!a.pagination.has_more_pages||x,children:["Next ",e.jsx(w,{className:"ml-1 h-4 w-4"})]})]})]})};export{ae 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.