PageSourceSearch

https://bbcc.ai/build/assets/handlepurchasehistory-kvVydbYi.js

js bbcc.ai collected 2026-10-05 12:13:29 UTC 9,051 bytes, 8 lines download raw bytes

1import{u as k,r as o,j as t,b as P,H as _,L as d}from"./app-DP13319Q.js";import{F as a,k as r,h as H,f as S,aw as C,j as x,ar as L,ai as D,at as A,g as F,az as z,au as M,av as T,ah as B}from"./index-CtyZ6W6U.js";import{D as I}from"./DraggableMenu-Bk7Spryo.js";import{M as V}from"./react-tooltip.min-DW3XhwOj.js";/* empty css            */import"./index-DQkUn08L.js";function J(){const{auth:u,template:$,purchases:l}=k().props,[i,m]=o.useState(!1),[y,E]=o.useState(!0),[p,f]=o.useState(l.current_page||1),[c,g]=o.useState(l.data),[n,h]=o.useState(l.current_page<l.last_page),j=o.useCallback(e=>new Date(e).toLocaleDateString("en-US",{weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),[]),N=o.useCallback(e=>{switch(e){case"completed":return t.jsx(a,{icon:S,className:"text-green-500"});case"failed":return t.jsx(a,{icon:H,className:"text-red-500"});case"pending":return t.jsx(a,{icon:r,className:"text-yellow-500 animate-spin"});default:return t.jsx(a,{icon:r,className:"text-gray-500"})}},[]),w=o.useCallback(async()=>{if(!(!n||i)){m(!0);try{const e=p+1,s=await P.get("/handlepurchasehistory",{params:{page:e}});s.data.data&&s.data.data.length>0?(g(v=>[...v,...s.data.data]),f(e),h(s.data.current_page<s.data.last_page)):h(!1)}catch(e){console.error("Error loading more purchases:",e)}finally{m(!1)}}},[p,n,i]),b=o.useCallback(e=>{const s=typeof e=="string"?parseFloat(e):e;return isNaN(s)?"0.00":s.toFixed(2)},[]);return t.jsxs(t.Fragment,{children:[t.jsxs(_,{children:[t.jsx("title",{children:"Handle Purchase History - Your Domain and Handle Transactions"}),t.jsx("meta",{name:"description",content:"View your domain and handle purchase history and transactions"}),t.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                `})]}),t.jsx(V,{id:"history-tooltip"}),t.jsx(I,{auth:u}),t.jsx("main",{className:"relative flex justify-end p-4 min-h-screen overflow-hidden",children:y&&t.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:t.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-6 space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(a,{icon:C,className:"text-yellow-400 text-2xl"}),t.jsx("h1",{className:"text-2xl font-bold text-white",children:"Handle Purchase History"})]}),t.jsxs(d,{href:"/ezdomain",className:"flex items-center gap-2 bg-yellow-400 text-black font-bold py-2 px-4 rounded-md hover:bg-yellow-500 transition-colors","data-tooltip-id":"history-tooltip","data-tooltip-content":"Purchase a new handle or domain",children:[t.jsx(a,{icon:x}),"Buy More Handles"]})]}),i&&c.length===0?t.jsx("div",{className:"flex justify-center items-center h-64",children:t.jsx(a,{icon:r,className:"text-yellow-400 text-4xl animate-spin"})}):c.length===0?t.jsxs("div",{className:"text-center py-12",children:[t.jsx(a,{icon:L,className:"text-gray-400 text-5xl mb-4"}),t.jsx("h3",{className:"text-xl font-medium text-gray-300 mb-2",children:"No purchases yet"}),t.jsx("p",{className:"text-gray-400 mb-6",children:"Your handle purchase history will appear here"}),t.jsxs(d,{href:"/ezdomain",className:"inline-flex items-center gap-2 bg-yellow-400 text-black font-bold py-2 px-6 rounded-md hover:bg-yellow-500 transition-colors","data-tooltip-id":"history-tooltip","data-tooltip-content":"Go to the domain purchase page",children:[t.jsx(a,{icon:x}),"Buy Domain Handles"]})]}):t.jsxs("div",{className:"overflow-x-auto",children:[t.jsxs("table",{className:"min-w-full divide-y divide-gray-700",children:[t.jsx("thead",{className:"bg-gray-900/50",children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"The purchased domain or handle URL",children:"Domain/Handle"}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Link to the transaction invoice",children:"Invoice"}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Total amount paid",children:"Amount"}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Amount paid using Bee Points",children:"Bee Points"}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Payment method used",children:"Method"}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Current status of the transaction",children:"Status"}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Date and time of the transaction",children:"Date"})]})}),t.jsx("tbody",{className:"bg-gray-800/50 divide-y divide-gray-700",children:c.map(e=>t.jsxs("tr",{className:"hover:bg-gray-700/50 transition-colors",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.domain?t.jsxs("div",{className:"flex items-center",children:[t.jsx(a,{icon:e.domain.type==="custom"?D:x,className:`mr-2 ${e.domain.type==="custom"?"text-blue-400":"text-green-400"}`}),t.jsx("a",{href:e.domain.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-white hover:underline","data-tooltip-id":"history-tooltip","data-tooltip-content":"Visit this URL in a new tab",children:e.domain.url})]}):t.jsx("span",{className:"text-sm text-gray-400",children:"N/A"})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.invoice?t.jsxs(d,{href:`/handle-invoice/${e.invoice.number}`,target:"_blank",className:"flex items-center text-sm text-blue-400 hover:text-blue-300 hover:underline","data-tooltip-id":"history-tooltip","data-tooltip-content":"View invoice details in a new tab",children:[t.jsx(a,{icon:A,className:"mr-2"}),e.invoice.number]}):t.jsx("span",{className:"text-sm text-gray-400",children:"N/A"})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(a,{icon:F,className:"text-green-400 mr-2"}),t.jsxs("span",{className:"text-sm font-medium text-white",children:["US$",b(e.amount)]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.bee_points_amount!==null?t.jsxs("div",{className:"flex items-center",children:[t.jsx(a,{icon:z,className:"text-yellow-400 mr-2"}),t.jsxs("span",{className:"text-sm font-medium text-white",children:["EZ$",Number(e.bee_points_amount).toFixed(2)]})]}):t.jsx("span",{className:"text-sm text-gray-400",children:"N/A"})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:"text-sm text-gray-300 capitalize",children:e.payment_method})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center","data-tooltip-id":"history-tooltip","data-tooltip-content":`Transaction status: ${e.status}`,children:[N(e.status),t.jsx("span",{className:"ml-2 text-sm text-gray-300 capitalize",children:e.status})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(a,{icon:M,className:"text-blue-400 mr-2"}),t.jsx("span",{className:"text-sm text-gray-300",children:j(e.processed_at)})]})})]},e.id))})]}),t.jsxs("div",{className:"mt-6 flex flex-col items-center space-y-4",children:[t.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":"history-tooltip","data-tooltip-content":"Scroll to the top of the page",children:[t.jsx(a,{icon:T}),"Back to Top"]}),n&&t.jsx("button",{onClick:w,disabled:i,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":"history-tooltip","data-tooltip-content":n?"Load the next page of purchase history":"No more purchases to load",children:i?t.jsxs(t.Fragment,{children:[t.jsx(a,{icon:r,className:"animate-spin"}),"Loading..."]}):t.jsxs(t.Fragment,{children:[t.jsx(a,{icon:B}),"Load More"]})})]})]})]})})})]})}export{J 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.