PageSourceSearch

https://playeros.ai/assets/AgencyAccounts-v8dDksw0.js

js playeros.ai collected 2026-10-05 12:25:34 UTC 4,751 bytes, 1 lines download raw bytes

1import{r as g,j as e}from"./vendor-ui-kEMjy5iA.js";import{ab as j,a9 as N,L as m,B as d,P as b,b as y,d as v,ag as w,J as A,U as C,a as M,M as I,ai as P,f as R,R as x}from"./index-DGws7P8O.js";import{a as k}from"./useAgencyAccounts-UkD6L_QV.js";import{a as S}from"./vendor-react-vSwiAXS4.js";import{f as _}from"./format-DHyRvYR2.js";import"./vendor-query-CK8S1K6m.js";import"./vendor-motion-DB-1S_On.js";import"./en-US-XrxtGoPx.js";const B={active:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",pending_payment:"bg-amber-500/15 text-amber-400 border-amber-500/30",suspended:"bg-destructive/15 text-destructive border-destructive/30"},q=()=>{const{data:n}=j(),{data:a,isLoading:p}=k((n==null?void 0:n.agencyAccountId)??null),i=S(),{startImpersonation:u}=N(),[l,o]=g.useState(null),h=(s,r)=>{u(s,r),i("/dashboard")},f=async(s,r)=>{o(s);try{const t=await R.functions.invoke("admin-resend-invite",{body:{account_id:s}});if(t.error)throw t.error;x({title:"Invite resent",description:`${r} admin will get a fresh set-password link in their inbox.`})}catch(t){x({title:"Couldn't resend",description:(t==null?void 0:t.message)??"Try again",variant:"destructive"})}finally{o(null)}};return p?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(m,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-2xl font-bold text-foreground",children:"Client Accounts"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[(a==null?void 0:a.length)??0," accounts"]})]}),e.jsxs(d,{onClick:()=>i("/agency/accounts/new"),className:"bg-gradient-to-r from-primary to-brand text-primary-foreground",children:[e.jsx(b,{className:"w-4 h-4 mr-1"})," New Account"]})]}),e.jsx(y,{className:"glass border-border/40",children:e.jsx(v,{className:"p-0",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/40",children:[e.jsx("th",{scope:"col",className:"text-left text-xs font-semibold text-muted-foreground uppercase p-4",children:"Account"}),e.jsx("th",{scope:"col",className:"text-left text-xs font-semibold text-muted-foreground uppercase p-4",children:"Properties"}),e.jsx("th",{scope:"col",className:"text-left text-xs font-semibold text-muted-foreground uppercase p-4",children:"Players"}),e.jsx("th",{scope:"col",className:"text-left text-xs font-semibold text-muted-foreground uppercase p-4",children:"Status"}),e.jsx("th",{scope:"col",className:"text-left text-xs font-semibold text-muted-foreground uppercase p-4",children:"Created"}),e.jsx("th",{scope:"col",className:"text-right text-xs font-semibold text-muted-foreground uppercase p-4",children:"Actions"})]})}),e.jsxs("tbody",{children:[a==null?void 0:a.map(s=>{var t,c;const r=s.status??"active";return e.jsxs("tr",{className:"border-b border-border/20 hover:bg-muted/30 transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[e.jsx(A,{className:"w-3.5 h-3.5"}),((t=s.properties)==null?void 0:t.length)??0]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[e.jsx(C,{className:"w-3.5 h-3.5"}),((c=s.totalPlayers)==null?void 0:c.toLocaleString())??0]})}),e.jsx("td",{className:"p-4",children:e.jsx(M,{variant:"outline",className:B[r]??"",children:r.replace("_"," ")})}),e.jsx("td",{className:"p-4 text-sm text-muted-foreground",children:_(new Date(s.created_at),"MMM d, yyyy")}),e.jsx("td",{className:"p-4 text-right",children:e.jsxs("div",{className:"flex justify-end gap-1",children:[(r==="pending_payment"||r==="trialing")&&e.jsxs(d,{variant:"ghost",size:"sm",onClick:()=>f(s.id,s.name),disabled:l===s.id,title:"Resend the welcome / set-password email",children:[l===s.id?e.jsx(m,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(I,{className:"w-3.5 h-3.5 mr-1"}),"Resend"]}),e.jsxs(d,{variant:"ghost",size:"sm",onClick:()=>h(s.id,s.name),className:"text-primary hover:text-primary",children:[e.jsx(P,{className:"w-3.5 h-3.5 mr-1"}),"Manage"]})]})})]},s.id)}),(!a||a.length===0)&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"p-8 text-center text-sm text-muted-foreground",children:"No accounts yet"})})]})]})})})})]})};export{q 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.