PageSourceSearch

https://bbcc.ai/build/assets/tokentransactions-UezxBQ5p.js

js bbcc.ai collected 2026-10-05 12:14:08 UTC 10,988 bytes, 8 lines download raw bytes

1import{u as S,r as s,j as t,b as A,H as L,L as f}from"./app-DP13319Q.js";import{F as a,aw as g,g as B,az as i,aR as y,av as j,ah as b,f as M,bw as F,t as H,u as Y,k as w,au as z}from"./index-CtyZ6W6U.js";import{D as I}from"./DraggableMenu-Bk7Spryo.js";import{M as N}from"./react-tooltip.min-DW3XhwOj.js";/* empty css            */import"./index-DQkUn08L.js";function O(){const{auth:v,template:R,transactions:c,totals:d}=S().props,[l,m]=s.useState(!1),[T,U]=s.useState(!0),[h,k]=s.useState(c.current_page||1),[x,_]=s.useState(c.data.map(e=>({...e,amount:Number(e.amount),balance_before:Number(e.balance_before),balance_after:Number(e.balance_after)}))),[p,u]=s.useState(c.current_page<c.last_page),r=s.useCallback(e=>e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),[]),P=s.useCallback(e=>new Date(e).toLocaleDateString("en-US",{weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),[]),E=s.useCallback(e=>{switch(e){case"handle_purchase":return t.jsx(a,{icon:M,className:"text-green-400 mr-3"});case"deposit":return t.jsx(a,{icon:b,className:"text-green-400 mr-3"});case"withdrawal":return t.jsx(a,{icon:j,className:"text-red-400 mr-3"});case"transfer":return t.jsx(a,{icon:y,className:"text-purple-400 mr-3"});case"reward":return t.jsx(a,{icon:i,className:"text-yellow-400 mr-3"});case"purchase":return t.jsx(a,{icon:B,className:"text-green-400 mr-3"});default:return t.jsx(a,{icon:g,className:"text-gray-400 mr-3"})}},[]),$=s.useCallback(e=>{switch(e){case"handle_purchase":return"Handle Purchase";case"deposit":return"Deposit";case"withdrawal":return"Withdrawal";case"transfer":return"Transfer";case"reward":return"Reward";case"purchase":return"Purchase";default:return e.split("_").map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" ")}},[]),C=s.useCallback(e=>e>=0?"text-green-400":"text-red-400",[]),Z=s.useCallback(async()=>{if(!(!p||l)){m(!0);try{const e=h+1,o=await A.get("/token-transactions",{params:{page:e}});if(o.data.data&&o.data.data.length>0){const D=o.data.data.map(n=>({...n,amount:Number(n.amount),balance_before:Number(n.balance_before),balance_after:Number(n.balance_after)}));_(n=>[...n,...D]),k(e),u(o.data.current_page<o.data.last_page)}else u(!1)}catch(e){console.error("Error loading more transactions:",e)}finally{m(!1)}}},[h,p,l]);return t.jsxs(t.Fragment,{children:[t.jsxs(L,{children:[t.jsx("title",{children:"Token Transactions - Your EZ$ Points History"}),t.jsx("meta",{name:"description",content:"View your EZ$ Points transaction history"}),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(N,{id:"action-tooltip"}),t.jsx(N,{id:"transaction-tooltip"}),t.jsx("div",{"data-tooltip-id":"action-tooltip","data-tooltip-content":"Drag to move the main menu",children:t.jsx(I,{auth:v})}),t.jsx("main",{className:"relative flex justify-end p-4 min-h-screen overflow-hidden",children:T&&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","data-tooltip-id":"action-tooltip","data-tooltip-content":"This panel displays your complete EZ$ Points transaction history",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","data-tooltip-id":"transaction-tooltip","data-tooltip-content":"Your detailed history of all EZ$ Points transactions",children:[t.jsx(a,{icon:g,className:"text-yellow-400 text-2xl"}),t.jsx("h1",{className:"text-2xl font-bold text-white",children:"Token Transactions"})]}),t.jsxs(f,{href:"/purchase",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":"action-tooltip","data-tooltip-content":"Purchase more EZ$ Points",children:[t.jsx(a,{icon:i}),"Buy More Points"]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[t.jsx("div",{className:"bg-gray-900/50 p-4 rounded-lg border border-gray-700","data-tooltip-id":"transaction-tooltip","data-tooltip-content":"Your current total EZ$ Points balance",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-gray-400",children:"Total Balance"}),t.jsxs("p",{className:"text-2xl font-bold text-white",children:["EZ$",r(d.total)]})]}),t.jsx(a,{icon:F,className:"text-yellow-400 text-xl"})]})}),t.jsx("div",{className:"bg-gray-900/50 p-4 rounded-lg border border-gray-700","data-tooltip-id":"transaction-tooltip","data-tooltip-content":"The sum of all your positive transactions",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-gray-400",children:"Total Deposits"}),t.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["+EZ$",r(d.positive)]})]}),t.jsx(a,{icon:H,className:"text-green-400 text-xl"})]})}),t.jsx("div",{className:"bg-gray-900/50 p-4 rounded-lg border border-gray-700","data-tooltip-id":"transaction-tooltip","data-tooltip-content":"The sum of all your negative transactions",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-gray-400",children:"Total Withdrawals"}),t.jsxs("p",{className:"text-2xl font-bold text-red-400",children:["-EZ$",r(d.negative)]})]}),t.jsx(a,{icon:Y,className:"text-red-400 text-xl"})]})})]}),l&&x.length===0?t.jsx("div",{className:"flex justify-center items-center h-64",children:t.jsx(a,{icon:w,className:"text-yellow-400 text-4xl animate-spin"})}):x.length===0?t.jsxs("div",{className:"text-center py-12",children:[t.jsx(a,{icon:y,className:"text-gray-400 text-5xl mb-4"}),t.jsx("h3",{className:"text-xl font-medium text-gray-300 mb-2",children:"No transactions yet"}),t.jsx("p",{className:"text-gray-400 mb-6",children:"Your EZ$ Points transaction history will appear here"}),t.jsxs(f,{href:"/purchase",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":"action-tooltip","data-tooltip-content":"Go to the purchase page",children:[t.jsx(a,{icon:i}),"Buy EZ$ Points"]})]}):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":"transaction-tooltip","data-tooltip-content":"The category of the transaction",children:"Type"}),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":"transaction-tooltip","data-tooltip-content":"The amount of EZ$ Points for this transaction",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":"transaction-tooltip","data-tooltip-content":"Your balance before this transaction occurred",children:"Balance Before"}),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":"transaction-tooltip","data-tooltip-content":"Your balance after this transaction occurred",children:"Balance After"}),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":"transaction-tooltip","data-tooltip-content":"The date and time of the transaction",children:"Date"})]})}),t.jsx("tbody",{className:"bg-gray-800/50 divide-y divide-gray-700",children:x.map(e=>t.jsxs("tr",{className:"hover:bg-gray-700/50 transition-colors",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap","data-tooltip-id":"transaction-tooltip","data-tooltip-content":`Ref ID: ${e.reference_id||"N/A"}`,children:t.jsxs("div",{className:"flex items-center",children:[E(e.transaction_type),t.jsx("span",{className:"text-sm font-medium text-white capitalize",children:$(e.transaction_type)})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap","data-tooltip-id":"transaction-tooltip","data-tooltip-content":"Positive values are credits (deposits), negative values are debits (withdrawals)",children:t.jsxs("div",{className:`flex items-center text-sm font-mono ${C(e.amount)}`,children:[t.jsx(a,{icon:i,className:"text-yellow-400 mr-2"}),t.jsxs("span",{children:[e.amount>=0?"+":"-","EZ$",r(Math.abs(e.amount))]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap","data-tooltip-id":"transaction-tooltip","data-tooltip-content":"The balance of your account before this transaction was processed",children:t.jsxs("div",{className:"flex items-center text-sm text-gray-300",children:[t.jsx(a,{icon:i,className:"text-yellow-400 mr-2"}),t.jsxs("span",{children:["EZ$",r(e.balance_before)]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap","data-tooltip-id":"transaction-tooltip","data-tooltip-content":"The balance of your account after this transaction was processed",children:t.jsxs("div",{className:"flex items-center text-sm text-gray-300",children:[t.jsx(a,{icon:i,className:"text-yellow-400 mr-2"}),t.jsxs("span",{children:["EZ$",r(e.balance_after)]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap","data-tooltip-id":"transaction-tooltip","data-tooltip-content":"The exact date and time the transaction was recorded",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(a,{icon:z,className:"text-blue-400 mr-2"}),t.jsx("span",{className:"text-sm text-gray-300",children:P(e.created_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":"action-tooltip","data-tooltip-content":"Scroll to the top of the page",children:[t.jsx(a,{icon:j}),"Back to Top"]}),p&&t.jsx("button",{onClick:Z,disabled:l,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":"action-tooltip","data-tooltip-content":"Load more of your transaction history",children:l?t.jsxs(t.Fragment,{children:[t.jsx(a,{icon:w,className:"animate-spin"}),"Loading..."]}):t.jsxs(t.Fragment,{children:[t.jsx(a,{icon:b}),"Load More"]})})]})]})]})})})]})}export{O 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.