module.exports=[33508,a=>{"use strict";var b=a.i(62213);a.s(["X",()=>b.default])},24569,a=>{"use strict";let b=(0,a.i(70106).default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);a.s(["Edit",()=>b],24569)},14548,a=>{"use strict";let b=(0,a.i(70106).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);a.s(["Save",()=>b],14548)},89923,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(99570),e=a.i(23292),f=a.i(5050);let g=(0,f.createServerReference)("60919f7cd93396bfd97e7c2267e520b8af20889892",f.callServer,void 0,f.findSourceMapURL,"updateUserQuota");var h=a.i(24569),i=a.i(14548),j=a.i(33508),k=a.i(66718);function l({initialData:a}){let[f,l]=(0,c.useState)(a),[m,n]=(0,c.useState)(null),[o,p]=(0,c.useState)(0),[q,r]=(0,c.useState)(!1),s=()=>{n(null)},t=async a=>{r(!0);try{let b=await g(a,o);b.success?(e.toast.success(b.message),l(f.map(b=>b.id===a?{...b,shortlink_quota:o}:b)),n(null)):e.toast.error(b.message)}catch(a){e.toast.error("Gagal memperbarui kuota",{description:a.message})}finally{r(!1)}},u=f.filter(a=>"admin"!==a.username);return(0,b.jsx)("div",{className:"space-y-4",children:(0,b.jsx)("div",{className:"border border-border/50 rounded-xl overflow-hidden bg-background",children:(0,b.jsx)("div",{className:"overflow-x-auto",children:(0,b.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,b.jsx)("thead",{className:"bg-muted/50 text-muted-foreground font-medium border-b border-border/50",children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{className:"px-4 py-3",children:"Nama Akun (Bidang)"}),(0,b.jsx)("th",{className:"px-4 py-3",children:"Username"}),(0,b.jsx)("th",{className:"px-4 py-3 text-center",children:"Kuota LASER"}),(0,b.jsx)("th",{className:"px-4 py-3 text-right",children:"Aksi"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/50",children:u.length>0?u.map(a=>(0,b.jsxs)("tr",{className:"hover:bg-muted/30 transition-colors",children:[(0,b.jsx)("td",{className:"px-4 py-3 font-medium text-foreground",children:a.name}),(0,b.jsxs)("td",{className:"px-4 py-3 text-muted-foreground font-mono text-xs",children:["@",a.username]}),(0,b.jsx)("td",{className:"px-4 py-3 text-center",children:m===a.id?(0,b.jsx)(k.Input,{type:"number",min:"0",value:o,onChange:a=>p(parseInt(a.target.value)||0),className:"w-20 text-center mx-auto h-8"}):(0,b.jsx)("span",{className:"font-bold text-lg",children:a.shortlink_quota??5})}),(0,b.jsx)("td",{className:"px-4 py-3 text-right",children:(0,b.jsx)("div",{className:"flex justify-end gap-1",children:m===a.id?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-emerald-600 hover:text-emerald-700 hover:bg-emerald-50",onClick:()=>t(a.id),disabled:q,children:(0,b.jsx)(i.Save,{className:"h-4 w-4"})}),(0,b.jsx)(d.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-neutral-500 hover:bg-neutral-100",onClick:s,disabled:q,children:(0,b.jsx)(j.X,{className:"h-4 w-4"})})]}):(0,b.jsx)(d.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-blue-600 hover:text-blue-700 hover:bg-blue-50",onClick:()=>{n(a.id),p(a.shortlink_quota||0)},children:(0,b.jsx)(h.Edit,{className:"h-4 w-4"})})})})]},a.id)):(0,b.jsx)("tr",{children:(0,b.jsx)("td",{colSpan:4,className:"p-10 text-center text-muted-foreground",children:"Belum ada data akun bidang."})})})]})})})})}a.s(["default",()=>l],89923)}];

//# sourceMappingURL=_f1ff2ebc._.js.map