PageSourceSearch

https://resolveit.ai/assets/dashboard-BiXWEXG3.js

js resolveit.ai collected 2026-10-05 15:16:46 UTC 8,138 bytes, 1 lines download raw bytes

1import{l as h,j as e,L as y,C as a,w as r,x as d,f as u,a as n,aw as p,c6 as v,o as w,i as l,c8 as B,e as c,av as o,ba as C}from"./pages-admin-CBNFTGIo.js";import{C as _}from"./index-DvZyzSM2.js";import"./pages-user-DBgyi5oE.js";import"./pages-public-Dm5I1a-v.js";function L(){const{data:s,isLoading:j}=h({queryKey:["/api/admin/corporate/stats"]}),{data:i}=h({queryKey:["/api/admin/corporate/metrics/breakdown"],enabled:!!s});return e.jsx(_,{children:e.jsxs("div",{className:"space-y-6","data-testid":"corporate-dashboard",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground","data-testid":"text-corporate-dashboard-title",children:"Corporate Dashboard"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Platform-wide corporate accounts overview"})]}),j?e.jsx("div",{className:"flex items-center justify-center py-12","data-testid":"corporate-stats-loading",children:e.jsx(y,{className:"h-6 w-6 animate-spin text-[#B8860B]"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-4",children:[e.jsxs(a,{"data-testid":"card-total-companies",children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(d,{className:"text-sm font-medium text-muted-foreground",children:"Companies"}),e.jsx(u,{className:"h-4 w-4 text-[#B8860B]"})]}),e.jsxs(n,{children:[e.jsx("div",{className:"text-2xl font-bold","data-testid":"text-total-companies",children:s?.totalCompanies??0}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Active companies"})]})]}),e.jsxs(a,{"data-testid":"card-total-employees",children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(d,{className:"text-sm font-medium text-muted-foreground",children:"Employees"}),e.jsx(p,{className:"h-4 w-4 text-[#B8860B]"})]}),e.jsxs(n,{children:[e.jsx("div",{className:"text-2xl font-bold","data-testid":"text-total-employees",children:s?.totalEmployees??0}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Active memberships"})]})]}),e.jsxs(a,{"data-testid":"card-total-corporate-users",children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(d,{className:"text-sm font-medium text-muted-foreground",children:"Corporate Users"}),e.jsx(v,{className:"h-4 w-4 text-[#B8860B]"})]}),e.jsxs(n,{children:[e.jsx("div",{className:"text-2xl font-bold","data-testid":"text-total-corporate-users",children:s?.totalCorporateUsers??0}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"With product role"})]})]}),e.jsxs(a,{"data-testid":"card-total-sessions",children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(d,{className:"text-sm font-medium text-muted-foreground",children:"Corp Sessions"}),e.jsx(w,{className:"h-4 w-4 text-[#B8860B]"})]}),e.jsxs(n,{children:[e.jsx("div",{className:"text-2xl font-bold","data-testid":"text-total-sessions",children:s?.totalCorporateSessions??0}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Total sessions"})]})]}),e.jsxs(a,{"data-testid":"card-resolution-rate",children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(d,{className:"text-sm font-medium text-muted-foreground",children:"Resolution Rate"}),e.jsx(l,{className:"h-4 w-4 text-[#B8860B]"})]}),e.jsxs(n,{children:[e.jsxs("div",{className:"text-2xl font-bold","data-testid":"text-resolution-rate",children:[s?.resolutionRate??0,"%"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Resolved / Total"})]})]}),e.jsxs(a,{"data-testid":"card-avg-resolution",children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(d,{className:"text-sm font-medium text-muted-foreground",children:"Avg Resolution Time"}),e.jsx(l,{className:"h-4 w-4 text-[#B8860B]"})]}),e.jsxs(n,{children:[e.jsxs("div",{className:"text-2xl font-bold","data-testid":"text-avg-resolution",children:[s?.avgResolutionDays??0," days"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Across all companies"})]})]}),e.jsxs(a,{"data-testid":"card-revenue",children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(d,{className:"text-sm font-medium text-muted-foreground",children:"MRR"}),e.jsx(B,{className:"h-4 w-4 text-[#B8860B]"})]}),e.jsxs(n,{children:[e.jsxs("div",{className:"text-2xl font-bold","data-testid":"text-revenue",children:["$",((s?.activeSubscriptionRevenueCents??0)/100).toFixed(0)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Active subscriptions"})]})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(c,{href:"/companies",children:e.jsxs("a",{className:"inline-flex items-center gap-2 px-4 py-2 bg-[#B8860B] text-white rounded-lg hover:bg-[#9A7209] transition-colors text-sm font-medium","data-testid":"link-view-companies",children:[e.jsx(u,{className:"h-4 w-4"}),"View Companies"]})}),e.jsx(c,{href:"/memberships",children:e.jsxs("a",{className:"inline-flex items-center gap-2 px-4 py-2 border border-[#B8860B] text-[#B8860B] rounded-lg hover:bg-[#B8860B]/5 transition-colors text-sm font-medium","data-testid":"link-view-memberships",children:[e.jsx(p,{className:"h-4 w-4"}),"View Memberships"]})})]}),i&&i.length>0&&e.jsxs(a,{"data-testid":"card-company-breakdown",children:[e.jsx(r,{children:e.jsxs(d,{className:"flex items-center gap-2 text-lg",children:[e.jsx(l,{className:"h-5 w-5 text-[#B8860B]"}),"Company Breakdown"]})}),e.jsx(n,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm","data-testid":"table-breakdown",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-left",children:[e.jsx("th",{className:"pb-2 font-medium text-muted-foreground",children:"Company"}),e.jsx("th",{className:"pb-2 font-medium text-muted-foreground text-center",children:"Employees"}),e.jsx("th",{className:"pb-2 font-medium text-muted-foreground text-center",children:"Sessions"}),e.jsx("th",{className:"pb-2 font-medium text-muted-foreground text-center",children:"Active"}),e.jsx("th",{className:"pb-2 font-medium text-muted-foreground text-center",children:"Resolved"}),e.jsx("th",{className:"pb-2 font-medium text-muted-foreground text-center",children:"Subscription"}),e.jsx("th",{className:"pb-2 font-medium text-muted-foreground text-right",children:"MRR"}),e.jsx("th",{className:"pb-2"})]})}),e.jsx("tbody",{className:"divide-y",children:i.map(t=>{const x=parseInt(t.total_sessions)||0,m=parseInt(t.resolved_sessions)||0,f=x>0?Math.round(m/x*100):0,N=parseInt(t.seat_count||"0")||0,b=parseInt(t.per_seat_price_cents||"0")||0,g=N*b/100;return e.jsxs("tr",{className:"hover:bg-muted/50","data-testid":`row-breakdown-${t.company_id}`,children:[e.jsxs("td",{className:"py-2.5",children:[e.jsx("div",{className:"font-medium",children:t.company_name}),e.jsx(o,{variant:"outline",className:"text-xs mt-0.5",children:t.status})]}),e.jsx("td",{className:"py-2.5 text-center",children:t.employee_count}),e.jsx("td",{className:"py-2.5 text-center",children:t.total_sessions}),e.jsx("td",{className:"py-2.5 text-center",children:e.jsx(o,{variant:"secondary",className:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:t.active_sessions})}),e.jsx("td",{className:"py-2.5 text-center",children:e.jsxs("span",{className:"text-xs text-muted-foreground",children:[m," (",f,"%)"]})}),e.jsx("td",{className:"py-2.5 text-center",children:e.jsx(o,{variant:"secondary",className:t.
1subscription_status==="active"?"bg-green-100 text-green-700":"bg-gray-100 text-gray-600",children:t.subscription_status||"None"})}),e.jsxs("td",{className:"py-2.5 text-right font-medium",children:["$",g.toFixed(0)]}),e.jsx("td",{className:"py-2.5 pl-2",children:e.jsx(c,{href:`/companies/${t.company_id}`,children:e.jsx("a",{className:"text-[#B8860B] hover:text-[#9A7209]","data-testid":`link-drilldown-${t.company_id}`,children:e.jsx(C,{className:"h-4 w-4"})})})})]},t.company_id)})})]})})})]})]})]})})}export{L 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.