PageSourceSearch

https://bbcc.ai/build/assets/incentivehistory-CXQcpdwT.js

js bbcc.ai collected 2026-10-05 12:13:33 UTC 8,516 bytes, 8 lines download raw bytes

1import{u as _,r as s,j as e,b as I,H as C,L as D}from"./app-DP13319Q.js";import{M as S}from"./react-tooltip.min-DW3XhwOj.js";import{F as a,k as l,bk as L,f as P,bl as p,as as F,b8 as z,aa as H,av as f,at as M,az as T,au as $,ah as A}from"./index-CtyZ6W6U.js";import{D as E}from"./DraggableMenu-Bk7Spryo.js";/* empty css            */import"./index-DQkUn08L.js";function J(){const{auth:j,template:V,incentives:n}=_().props,[o,x]=s.useState(!1),[g,B]=s.useState(!0),[m,y]=s.useState(n.current_page||1),[c,b]=s.useState(n.data.map(t=>({...t,amount:Number(t.amount)}))),[d,u]=s.useState(n.current_page<n.last_page),h=s.useCallback(t=>new Date(t).toLocaleDateString("en-US",{weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),[]),v=s.useCallback(t=>{switch(t){case"distributed":return e.jsx(a,{icon:P,className:"text-green-500"});case"failed":return e.jsx(a,{icon:L,className:"text-red-500"});case"pending":return e.jsx(a,{icon:l,className:"text-yellow-500 animate-spin"});default:return e.jsx(a,{icon:l,className:"text-gray-500"})}},[]),N=s.useCallback(t=>{switch(t.toLowerCase()){case"sign up":case"signup":return e.jsx(a,{icon:H,className:"text-blue-400"});case"create funnel":return e.jsx(a,{icon:z,className:"text-purple-400"});case"frame create":return e.jsx(a,{icon:F,className:"text-orange-400"});default:return e.jsx(a,{icon:p,className:"text-yellow-400"})}},[]),w=s.useCallback(async()=>{if(!(!d||o)){x(!0);try{const t=m+1,i=await I.get("/incentivehistory/load-more",{params:{page:t}});if(i.data.data&&i.data.data.length>0){const k=i.data.data.map(r=>({...r,amount:Number(r.amount)}));b(r=>[...r,...k]),y(t),u(i.data.current_page<i.data.last_page)}else u(!1)}catch(t){console.error("Error loading more incentives:",t)}finally{x(!1)}}},[m,d,o]);return e.jsxs(e.Fragment,{children:[e.jsxs(C,{children:[e.jsx("title",{children:"Incentive History - Your Reward Transactions"}),e.jsx("meta",{name:"description",content:"View your incentive and reward 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(S,{id:"incentive-tooltip"}),e.jsx(E,{auth:j}),e.jsx("main",{className:"relative flex justify-end p-4 min-h-screen overflow-hidden",children:g&&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.jsxs("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:p,className:"text-purple-400 text-2xl"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"Incentive History"})]}),e.jsxs(D,{href:"/dashboard",className:"flex items-center gap-2 bg-purple-500 text-white font-bold py-2 px-4 rounded-md hover:bg-purple-600 transition-colors","data-tooltip-id":"incentive-tooltip","data-tooltip-content":"Return to dashboard",children:[e.jsx(a,{icon:f}),"Back to Dashboard"]})]}),o&&c.length===0?e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(a,{icon:l,className:"text-purple-400 text-4xl animate-spin"})}):c.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(a,{icon:p,className:"text-gray-400 text-5xl mb-4"}),e.jsx("h3",{className:"text-xl font-medium text-gray-300 mb-2",children:"No incentives yet"}),e.jsx("p",{className:"text-gray-400 mb-6",children:"Your incentive history will appear here as you earn rewards"})]}):e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"min-w-full divide-y divide-gray-700",children:[e.jsx("thead",{className:"bg-gray-900/50",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-purple-400 uppercase tracking-wider","data-tooltip-id":"incentive-tooltip","data-tooltip-content":"Your unique invoice number",children:"Invoice"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-purple-400 uppercase tracking-wider","data-tooltip-id":"incentive-tooltip","data-tooltip-content":"Type of incentive earned",children:"Type"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-purple-400 uppercase tracking-wider","data-tooltip-id":"incentive-tooltip","data-tooltip-content":"Amount of Bee Points earned",children:"Points"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-purple-400 uppercase tracking-wider","data-tooltip-id":"incentive-tooltip","data-tooltip-content":"Description of the incentive",children:"Description"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-purple-400 uppercase tracking-wider","data-tooltip-id":"incentive-tooltip","data-tooltip-content":"Current status of the incentive",children:"Status"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-purple-400 uppercase tracking-wider","data-tooltip-id":"incentive-tooltip","data-tooltip-content":"Date and time the incentive was distributed",children:"Distributed Date"})]})}),e.jsx("tbody",{className:"bg-gray-800/50 divide-y divide-gray-700",children:c.map(t=>e.jsxs("tr",{className:"hover:bg-gray-700/50 transition-colors","data-tooltip-id":"incentive-tooltip","data-tooltip-content":`Incentive ID: ${t.incentive_id}`,children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("a",{href:`/invoiceincentive/${t.invoice_number||"INC-"+t.incentive_id}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-sm text-blue-400 hover:text-blue-300 hover:underline","data-tooltip-id":"incentive-tooltip","data-tooltip-content":"View your invoice in a new tab",children:[e.jsx(a,{icon:M,className:"mr-2"}),t.invoice_number||"INC-"+t.incentive_id]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap","data-tooltip-id":"incentive-tooltip","data-tooltip-content":t.incentive_type,children:e.jsxs("div",{className:"flex items-center",children:[N(t.incentive_type),e.jsx("span",{className:"ml-2 text-sm font-medium text-white capitalize",children:t.incentive_type})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap","data-tooltip-id":"incentive-tooltip","data-tooltip-content":`EZ$${t.amount.toFixed(2)}`,children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(a,{icon:T,className:"text-yellow-400 mr-2"}),e.jsxs("span",{className:"text-sm font-medium text-white",children:["EZ$",t.amount.toFixed(2)]})]})}),e.jsx("td",{className:"px-6 py-4","data-tooltip-id":"incentive-tooltip","data-tooltip-content":t.de
8scription,children:e.jsx("span",{className:"text-sm text-gray-300",children:t.description})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap","data-tooltip-id":"incentive-tooltip","data-tooltip-content":`Incentive is ${t.status}`,children:e.jsxs("div",{className:"flex items-center",children:[v(t.status),e.jsx("span",{className:"ml-2 text-sm text-gray-300 capitalize",children:t.status})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap","data-tooltip-id":"incentive-tooltip","data-tooltip-content":h(t.distributed_at),children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(a,{icon:$,className:"text-blue-400 mr-2"}),e.jsx("span",{className:"text-sm text-gray-300",children:h(t.distributed_at)})]})})]},t.incentive_history_id))})]}),e.jsxs("div",{className:"mt-6 flex flex-col items-center space-y-4",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":"incentive-tooltip","data-tooltip-content":"Scroll to the top of the page",children:[e.jsx(a,{icon:f}),"Back to Top"]}),d&&e.jsx("button",{onClick:w,disabled:o,className:"flex items-center gap-2 bg-purple-500 text-white font-bold py-2 px-6 rounded-md hover:bg-purple-600 transition-colors disabled:opacity-50","data-tooltip-id":"incentive-tooltip","data-tooltip-content":"Load more incentive records",children:o?e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:l,className:"animate-spin"}),"Loading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:A}),"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.