1import{u as F,r,j as e,b as v,H as D}from"./app-DP13319Q.js";import{F as a,k as c,f as N,aw as A,aR as w,P as _,aE as E,ah as C,av as z,al as V,j as I}from"./index-CtyZ6W6U.js";import{D as Y}from"./DraggableMenu-Bk7Spryo.js";import{M as G}from"./react-tooltip.min-DW3XhwOj.js";/* empty css */import"./index-DQkUn08L.js";function X(){const{auth:S,template:U,sentTransfers:T,receivedTransfers:k}=F().props,[H,B]=r.useState(!0),[n,l]=r.useState(!1),[d,p]=r.useState(1),[h,P]=r.useState(T),[g,R]=r.useState(k),[m,f]=r.useState(!0),[x,j]=r.useState(!0),M=r.useCallback(t=>{switch(t){case!0:return e.jsx(a,{icon:N,className:"text-green-500"});case!1:return e.jsx(a,{icon:c,className:"text-yellow-500 animate-spin"});default:return e.jsx(a,{icon:c,className:"text-gray-500"})}},[]),L=r.useCallback(async()=>{if(!(!m||n)){l(!0);try{const t=d+1,s=await v.get("/transferhistory/sent",{params:{page:t}});s.data.data&&s.data.data.length>0?(P(i=>[...i,...s.data.data]),p(t),f(s.data.current_page<s.data.last_page)):f(!1)}catch(t){console.error("Error loading more sent transfers:",t)}finally{l(!1)}}},[d,m,n]),$=r.useCallback(async()=>{if(!(!x||n)){l(!0);try{const t=d+1,s=await v.get("/transferhistory/received",{params:{page:t}});s.data.data&&s.data.data.length>0?(R(i=>[...i,...s.data.data]),p(t),j(s.data.current_page<s.data.last_page)):j(!1)}catch(t){console.error("Error loading more received transfers:",t)}finally{l(!1)}}},[d,x,n]),o=t=>new Date(t).toLocaleDateString("en-US",{weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),u=t=>t==="domain"?V:I;return e.jsxs(e.Fragment,{children:[e.jsxs(D,{children:[e.jsx("title",{children:"Transfer History - Your Handle Transfers"}),e.jsx("meta",{name:"description",content:"View your domain and custom handle transfer history"}),e.jsx("style",{children:` 2 .react-tooltip { 3 z-index: 99999 !important; 4 opacity: 1 !important; 5 font-size: 12px; 6 padding: 4px 8px; 7 } 8 `})]}),e.jsx(G,{id:"transfer-tooltip"}),e.jsx(Y,{auth:S}),e.jsx("main",{className:"relative flex justify-end p-4 min-h-screen overflow-hidden",children:H&&e.jsx("div",{className:"relative mt-4 mx-auto bottom-4 z-50 backdrop-blur-sm p-4 rounded-xl border border-white-700 overflow-y-auto shadow-2xl w-full max-w-6xl",children:e.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-6 space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between mb-6",children:e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(a,{icon:A,className:"text-yellow-400 text-2xl"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"Transfer History"})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-gray-900/50 p-6 rounded-lg border border-gray-700",children:[e.jsxs("h2",{className:"text-xl font-bold text-white mb-6 flex items-center",children:[e.jsx(a,{icon:w,className:"mr-2 text-yellow-400"}),e.jsx("span",{children:"Sent Transfers"})]}),h.length>0?e.jsx("div",{className:"space-y-4",children:h.map(t=>e.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700 hover:bg-gray-700/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(a,{icon:u(t.handle_type),className:"text-lg mr-3 text-cyan-400","data-tooltip-id":"transfer-tooltip","data-tooltip-content":t.handle_type==="domain"?"Domain Handle":"Custom Handle"}),e.jsx("a",{href:t.handle_url,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-white hover:underline","data-tooltip-id":"transfer-tooltip","data-tooltip-content":"View handle in a new tab",children:t.handle_name})]}),e.jsxs("div",{className:"flex items-center","data-tooltip-id":"transfer-tooltip","data-tooltip-content":`Status: ${t.used?"Completed":"Pending"}`,children:[M(t.used),e.jsx("span",{className:"ml-2 text-sm text-gray-300 capitalize",children:t.used?"Completed":"Pending"})]})]}),t.recipient?e.jsxs("div",{className:"flex items-center text-sm text-gray-400 mt-3","data-tooltip-id":"transfer-tooltip","data-tooltip-content":`Sent to ${t.recipient.name} (${t.recipient.email})`,children:[e.jsx(a,{icon:_,className:"mr-2"}),e.jsxs("span",{children:["To: ",t.recipient.name," (",t.recipient.email,")"]})]}):e.jsxs("div",{className:"text-sm text-gray-400 mt-3",children:[e.jsx(a,{icon:E,className:"mr-2"}),e.jsx("span",{children:"Waiting for recipient"})]}),e.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mt-3",children:[e.jsxs("span",{"data-tooltip-id":"transfer-tooltip","data-tooltip-content":`Created on ${o(t.created_at)}`,children:["Created: ",o(t.created_at)]}),t.transferred_at&&e.jsxs("span",{"data-tooltip-id":"transfer-tooltip","data-tooltip-content":`Completed on ${o(t.transferred_at)}`,children:["Completed: ",o(t.transferred_at)]})]})]},t.id))}):e.jsx("div",{className:"text-center py-8 text-gray-400",children:"You haven't initiated any transfers yet."}),m&&e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx("button",{onClick:L,disabled:n,className:"flex items-center gap-2 bg-yellow-400 text-black font-bold py-2 px-6 rounded-md hover:bg-yellow-500 transition-colors disabled:opacity-50","data-tooltip-id":"transfer-tooltip","data-tooltip-content":"Load more sent transfer records",children:n?e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:c,
8className:"animate-spin"}),"Loading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:C}),"Load More"]})})})]}),e.jsxs("div",{className:"bg-gray-900/50 p-6 rounded-lg border border-gray-700",children:[e.jsxs("h2",{className:"text-xl font-bold text-white mb-6 flex items-center",children:[e.jsx(a,{icon:w,className:"mr-2 text-green-400"}),e.jsx("span",{children:"Received Transfers"})]}),g.length>0?e.jsx("div",{className:"space-y-4",children:g.map(t=>{var s,i,y,b;return e.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700 hover:bg-gray-700/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(a,{icon:u(t.handle_type),className:"text-lg mr-3 text-cyan-400","data-tooltip-id":"transfer-tooltip","data-tooltip-content":t.handle_type==="domain"?"Domain Handle":"Custom Handle"}),e.jsx("a",{href:t.handle_url,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-white hover:underline","data-tooltip-id":"transfer-tooltip","data-tooltip-content":"View handle in a new tab",children:t.handle_name})]}),e.jsxs("div",{className:"flex items-center","data-tooltip-id":"transfer-tooltip","data-tooltip-content":"Status: Completed",children:[e.jsx(a,{icon:N,className:"text-green-500"}),e.jsx("span",{className:"ml-2 text-sm text-gray-300 capitalize",children:"Completed"})]})]}),e.jsxs("div",{className:"flex items-center text-sm text-gray-400 mt-3","data-tooltip-id":"transfer-tooltip","data-tooltip-content":`Received from ${(s=t.sender)==null?void 0:s.name} (${(i=t.sender)==null?void 0:i.email})`,children:[e.jsx(a,{icon:_,className:"mr-2"}),e.jsxs("span",{children:["From: ",(y=t.sender)==null?void 0:y.name," (",(b=t.sender)==null?void 0:b.email,")"]})]}),e.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mt-3",children:[e.jsxs("span",{"data-tooltip-id":"transfer-tooltip","data-tooltip-content":`Created on ${o(t.created_at)}`,children:["Created: ",o(t.created_at)]}),e.jsxs("span",{"data-tooltip-id":"transfer-tooltip","data-tooltip-content":`Received on ${o(t.transferred_at)}`,children:["Received: ",o(t.transferred_at)]})]})]},t.id)})}):e.jsx("div",{className:"text-center py-8 text-gray-400",children:"You haven't received any transfers yet."}),x&&e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx("button",{onClick:$,disabled:n,className:"flex items-center gap-2 bg-yellow-400 text-black font-bold py-2 px-6 rounded-md hover:bg-yellow-500 transition-colors disabled:opacity-50","data-tooltip-id":"transfer-tooltip","data-tooltip-content":"Load more received transfer records",children:n?e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:c,className:"animate-spin"}),"Loading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:C}),"Load More"]})})})]})]}),e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsxs("button",{className:"flex items-center gap-2 bg-gray-700 text-white px-4 py-2 rounded-md hover:bg-gray-600 transition-colors",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),"data-tooltip-id":"transfer-tooltip","data-tooltip-content":"Scroll to the top of the page",children:[e.jsx(a,{icon:z}),"Back to Top"]})})]})})})]})}export{X 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.