1import{c as h,N as i,P as l,h as f,j as e,L as r,B as j,p as c,q as d,s as o,t as m}from"./index-BksOXtpN.js";import{o as v,l as y}from"./clients.functions-FWFcf1JJ.js";import{S as g}from"./status-badge-2HgyWq_U.js";import{U as N}from"./users-9ogLJpF8.js";import{D as b}from"./dollar-sign-CNR4AYgq.js";const w=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],C=h("file-exclamation-point",w);function x(a){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format((a??0)/100)}function U(){const a=i(v),u=i(y),t=l({queryKey:["overview-stats"],queryFn:()=>a()}),n=(l({queryKey:["clients"],queryFn:()=>u()}).data??[]).slice(0,6),p=[{label:"Active clients",value:t.data?.activeClients??"â",icon:N},{label:"MRR",value:x(t.data?.mrr??0),icon:b},{label:"Disputes in flight",value:t.data?.inFlight??"â",icon:C},{label:"Success rate",value:`${t.data?.successRate??0}%`,icon:f}];return e.jsxs("div",{className:"mx-auto max-w-7xl space-y-6 p-6",children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Overview"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your clients at a glance."})]}),e.jsx(r,{to:"/app/clients",children:e.jsx(j,{children:"View clients"})})]}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:p.map(s=>e.jsxs(c,{children:[e.jsxs(d,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(o,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:s.label}),e.jsx(s.icon,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(m,{children:e.jsx("div",{className:"text-3xl font-semibold tabular-nums",children:s.value})})]},s.label))}),e.jsxs(c,{children:[e.jsx(d,{children:e.jsx(o,{className:"text-base",children:"Recent clients"})}),e.jsx(m,{children:n.length===0?e.jsx("p",{className:"py-10 text-center text-sm text-muted-foreground",children:"No clients yet. Add your first one from the Clients tab."}):e.jsx("div",{className:"divide-y divide-border",children:n.map(s=>e.jsxs(r,{to:"/app/clients/$clientId",params:{clientId:s.id},className:"flex items-center justify-between py-3 hover:bg-muted/40 -mx-2 px-2 rounded",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium",children:[s.first_name," ",s.last_name]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.email})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"text-sm tabular-nums text-muted-foreground",children:[x(s.monthly_fee_cents),"/mo"]}),e.jsx(g,{status:s.status})]})]},s.id))})})]})]})}export{U as component};
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.