(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5792],{87728:function(e,t,r){Promise.resolve().then(r.bind(r,12928))},39763:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var a=r(2265),s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),l=(e,t)=>{let r=(0,a.forwardRef)((r,l)=>{let{color:i="currentColor",size:c=24,strokeWidth:d=2,absoluteStrokeWidth:o,className:m="",children:x,...h}=r;return(0,a.createElement)("svg",{ref:l,...s,width:c,height:c,stroke:i,strokeWidth:o?24*Number(d)/Number(c):d,className:["lucide","lucide-".concat(n(e)),m].join(" "),...h},[...t.map(e=>{let[t,r]=e;return(0,a.createElement)(t,r)}),...Array.isArray(x)?x:[x]])});return r.displayName="".concat(e),r}},95805:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});let a=(0,r(39763).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},12928:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return l}});var a=r(57437),s=r(2265),n=r(95805);function l(){let[e,t]=(0,s.useState)([]),[r,l]=(0,s.useState)(!0);return((0,s.useEffect)(()=>{fetch("/api/affiliate/referrals").then(e=>e.json()).then(e=>t(e.referrals||[])).catch(console.error).finally(()=>l(!1))},[]),r)?(0,a.jsx)("div",{className:"flex justify-center py-12",children:(0,a.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-emerald-600"})}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Referral Saya"}),(0,a.jsx)("div",{className:"card",children:e.length>0?(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-gray-200",children:[(0,a.jsx)("th",{className:"text-left py-3 font-medium text-gray-500",children:"Nama Tenant"}),(0,a.jsx)("th",{className:"text-left py-3 font-medium text-gray-500",children:"Paket"}),(0,a.jsx)("th",{className:"text-center py-3 font-medium text-gray-500",children:"Status"}),(0,a.jsx)("th",{className:"text-right py-3 font-medium text-gray-500",children:"Total Komisi"}),(0,a.jsx)("th",{className:"text-right py-3 font-medium text-gray-500",children:"Bergabung"})]})}),(0,a.jsx)("tbody",{children:e.map(e=>(0,a.jsxs)("tr",{className:"border-b border-gray-100",children:[(0,a.jsx)("td",{className:"py-3 text-gray-900 font-medium",children:e.name}),(0,a.jsx)("td",{className:"py-3",children:(0,a.jsx)("span",{className:"inline-block px-2 py-0.5 rounded text-xs font-medium ".concat("free"===e.plan?"bg-gray-100 text-gray-600":"bg-emerald-100 text-emerald-700"),children:e.plan})}),(0,a.jsx)("td",{className:"py-3 text-center",children:(0,a.jsx)("span",{className:"inline-block px-2 py-0.5 rounded text-xs font-medium ".concat(e.isActive?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:e.isActive?"Aktif":"Nonaktif"})}),(0,a.jsxs)("td",{className:"py-3 text-right text-gray-600",children:[e.totalCommissions,"x"]}),(0,a.jsx)("td",{className:"py-3 text-right text-gray-500",children:new Date(e.createdAt).toLocaleDateString("id-ID")})]},e.id))})]})}):(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)(n.Z,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),(0,a.jsx)("p",{className:"text-gray-500",children:"Belum ada referral"}),(0,a.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:"Bagikan kode referral Anda untuk mulai mendapatkan komisi"})]})})]})}}},function(e){e.O(0,[2971,2117,1744],function(){return e(e.s=87728)}),_N_E=e.O()}]);