PageSourceSearch

https://living-corporate.com/assets/admin-portal-NzRqwyvZ.js

js living-corporate.com collected 2026-10-02 05:00:32 UTC 5,670 bytes, 1 lines download raw bytes

1import{f as m,i as j,j as e,B as g,o,aO as N}from"./index-QiiZ-xPT.js";import{N as y}from"./Navigation-r93ZBuy6.js";import{F as b}from"./Footer-3JNsJayo.js";import{C as d,b as p,c as x,a as l}from"./card-DkXabqFf.js";import{B as f}from"./badge-IOHUIid2.js";import"./label-BA9Xin3m.js";import"./checkbox-CrGTwbPu.js";import"./index-DqZlRfV5.js";import"./check-KTa2Xihg.js";import"./select-B1P2Vx_w.js";import"./index-BMyKsIJE.js";import"./Combination-TP2Egp2x.js";import"./chevron-down-BWOHa16b.js";import"./dialog-D2VXyQJN.js";import"./save-BsB7cS8F.js";import"./dropdown-menu-D4zjGRmc.js";import"./index-Bj3iuRQR.js";import"./chevron-right-f4G5e4zR.js";import"./circle-2nw1jhuN.js";import"./useTranslation-XedzLvcK.js";import"./globe-3tsuvpPT.js";import"./log-out-CqAuLeet.js";import"./building-2-Bz-h5bHH.js";import"./BrandSponsor-DEW6i_On.js";import"./mail-Cr62Xklx.js";import"./twitter-BzZd48jL.js";function h(s){return`$${(s/100).toLocaleString("en-US",{maximumFractionDigits:0})}`}function u(s){return s?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"—"}function V(){const s=m({queryKey:["/api/admin/portal/admin/tenants"]}),n=m({queryKey:["/api/admin/portal/admin/kpis"]}),r=j({mutationFn:async()=>(await N("POST","/api/admin/portal/admin/meter-now",{})).json(),onSuccess:()=>s.refetch()}),a=n.data?.kpis,c=s.data?.tenants??[];return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(y,{}),e.jsxs("main",{className:"max-w-7xl mx-auto px-6 py-12","data-testid":"page-admin-portal",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold mb-1","data-testid":"text-page-title",children:"Multi-Tenant Learning Portal — admin"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"MRR is estimated (catalog price + projected overage). Reconcile against Stripe monthly."})]}),e.jsx(g,{onClick:()=>r.mutate(),disabled:r.isPending,"data-testid":"button-meter-now",children:r.isPending?e.jsxs(e.Fragment,{children:[e.jsx(o,{className:"w-4 h-4 mr-2 animate-spin"})," Metering…"]}):"Run seat metering now"})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[e.jsx(i,{label:"Active tenants",value:a?.activeTenants??0,testId:"kpi-active"}),e.jsx(i,{label:"Trialing",value:a?.trialingTenants??0,testId:"kpi-trialing"}),e.jsx(i,{label:"Total seats",value:a?.totalSeats??0,testId:"kpi-seats"}),e.jsx(i,{label:"Est. MRR",value:a?h(a.estimatedMrrCents):"—",testId:"kpi-mrr"})]}),e.jsxs(d,{className:"mb-8","data-testid":"card-by-tier",children:[e.jsx(p,{children:e.jsx(x,{children:"By tier"})}),e.jsx(l,{children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-left text-muted-foreground border-b",children:[e.jsx("th",{className:"py-2",children:"Tier"}),e.jsx("th",{className:"py-2",children:"Tenants"}),e.jsx("th",{className:"py-2",children:"Est. MRR"})]})}),e.jsx("tbody",{children:a?.byTier.map(t=>e.jsxs("tr",{className:"border-b","data-testid":`row-tier-${t.tierSlug}`,children:[e.jsx("td",{className:"py-2",children:t.tierSlug}),e.jsx("td",{className:"py-2",children:t.count}),e.jsx("td",{className:"py-2",children:h(t.mrrCents)})]},t.tierSlug))})]})})]}),e.jsxs(d,{"data-testid":"card-tenants",children:[e.jsx(p,{children:e.jsx(x,{children:"Tenants"})}),e.jsx(l,{children:s.isLoading?e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx(o,{className:"w-4 h-4 animate-spin inline mr-2"})," Loading…"]}):c.length===0?e.jsx("div",{className:"text-muted-foreground","data-testid":"text-empty",children:"No portal tenants yet."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-left text-muted-foreground border-b",children:[e.jsx("th",{className:"py-2 pr-3",children:"Org"}),e.jsx("th",{className:"py-2 pr-3",children:"Tier"}),e.jsx("th",{className:"py-2 pr-3",children:"Sub status"}),e.jsx("th",{className:"py-2 pr-3",children:"Seats"}),e.jsx("th",{className:"py-2 pr-3",children:"Overage"}),e.jsx("th",{className:"py-2 pr-3",children:"Renews"}),e.jsx("th",{className:"py-2 pr-3",children:"Last metered"}),e.jsx("th",{className:"py-2 pr-3",children:"Contact"})]})}),e.jsx("tbody",{children:c.map(t=>e.jsxs("tr",{className:"border-b","data-testid":`row-tenant-${t.id}`,children:[e.jsx("td",{className:"py-2 pr-3",children:t.organizationSlug?e.jsx("a",{className:"underline",href:`/o/${t.organizationSlug}/admin/billing`,children:t.organizationName??t.organizationSlug}):e.jsx("span",{className:"text-muted-foreground",children:"unprovisioned"})}),e.jsx("td",{className:"py-2 pr-3",children:t.tierSlug}),e.jsx("td",{className:"py-2 pr-3",children:e.jsx(f,{variant:t.subscriptionStatus==="active"?"default":"outline",children:t.subscriptionStatus??t.status})}),e.jsxs("td",{className:"py-2 pr-3",children:[t.seatsUsed," / ",t.seatsIncluded]}),e.jsx("td",{className:"py-2 pr-3",children:t.seatsOverage>0?`+${t.seatsOverage}`:"—"}),e.jsx("td",{className:"py-2 pr-3",children:u(t.currentPeriodEnd)}),e.jsx("td",{className:"py-2 pr-3",children:u(t.lastMeteredAt)}),e.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:t.primaryContactEmail})]},t.id))})]})})})]})]}),e.jsx(b,{})]})}function i({label:s,value:n,testId:r}){return e.jsx(d,{"data-testid":r,children:e.jsxs(l,{className:"p-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:s}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:n})]})})}export{V 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.