PageSourceSearch

https://msastroacademy.com/assets/enterprise-overview-EqxeT721.js

js msastroacademy.com collected 2026-09-24 14:49:18 UTC 6,900 bytes, 1 lines download raw bytes

1import{r as i,j as e}from"./react-vendor-DDlTsOEd.js";import{A as j,C as v}from"./AdminLayout-C0t6TWD9.js";import{g as n,d as f,R as y,a5 as b}from"./index-dMYrr1t8.js";import{T as N}from"./trending-up-DoFbyDMF.js";import{R as c,X as x,Y as m,T as h,Z as k}from"./generateCategoricalChart-Ck9viAt8.js";import{A as w,a as S}from"./AreaChart-CRImCOjK.js";import{C as p}from"./CartesianGrid-C4jh-EZG.js";import{B as C}from"./BarChart-iAy9exWa.js";import"./megaphone-CG_Y22E9.js";import"./clipboard-check-H9MOfMyT.js";import"./database-BMcpOIuo.js";import"./tag-CsU2rQcC.js";import"./credit-card-CV_Lm4ZC.js";const A=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],M=n("building-2",A);const z=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]],P=n("headphones",z);const E=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],L=n("layers",E);function l(r){return`₹${Math.round(r/100).toLocaleString("en-IN")}`}function q(){const[r,g]=i.useState("week"),[a,o]=i.useState(null),[u,d]=i.useState(!0);i.useEffect(()=>{d(!0),f.get(`/admin/enterprise/overview?grain=${r}`).then(s=>o(s.data??null)).catch(()=>o(null)).finally(()=>d(!1))},[r]);const t=a?.platform;return e.jsx(j,{children:e.jsxs("div",{className:"max-w-7xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(M,{size:26,className:"text-indigo-600"}),"Enterprise overview"]}),e.jsx("p",{className:"text-sm text-gray-900 mt-1",children:"Platform KPIs across students, finance, AI, batches, live classes and support."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-gray-900 uppercase",children:"Period"}),e.jsxs("select",{value:r,onChange:s=>g(s.target.value),className:"border border-gray-200 rounded-xl px-3 py-2 text-sm bg-white",children:[e.jsx("option",{value:"day",children:"Daily"}),e.jsx("option",{value:"week",children:"Weekly"}),e.jsx("option",{value:"month",children:"Monthly"}),e.jsx("option",{value:"year",children:"Yearly"})]})]})]}),u&&e.jsxs("div",{className:"text-sm text-gray-900 flex items-center gap-2",children:[e.jsx(y,{size:14,className:"animate-spin"})," Loading metrics…"]}),t&&e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Active students",value:t.activeStudents},{label:"Staff admin seats",value:t.staffAdminAccounts},{label:"Instructor slots",value:t.activeInstructorSlots},{label:"Total enrollments",value:t.totalEnrollments},{label:"Lifetime revenue",value:l(t.lifetimeRevenuePaise)},{label:"Mo. revenue (approx)",value:l(t.monthlyRevenueProxyPaise)},{label:"Failed pays (30d)",value:t.failedPayments30d},{label:"Engagement hits (7d)",value:t.engagementEvents7d}].map(s=>e.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 p-4 shadow-sm",children:[e.jsx("p",{className:"text-[11px] text-gray-900 uppercase tracking-wide",children:s.label}),e.jsx("p",{className:"text-xl font-semibold text-gray-900 mt-1",children:s.value})]},s.label))}),a&&e.jsxs("div",{className:"grid lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 p-4 shadow-sm lg:col-span-3",children:[e.jsxs("h2",{className:"text-sm font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[e.jsx(N,{size:16,className:"text-emerald-500"})," Enrollment & revenue series"]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 h-72",children:[e.jsx(c,{width:"100%",height:"100%",children:e.jsxs(w,{data:a.charts.enrollmentsOverTime,children:[e.jsx(p,{strokeDasharray:"3 3",stroke:"#eef2ff"}),e.jsx(x,{dataKey:"bucket",tick:{fontSize:10}
1,tickFormatter:s=>String(s).slice(0,10)}),e.jsx(m,{tick:{fontSize:10}}),e.jsx(h,{}),e.jsx(S,{type:"monotone",dataKey:"count",stroke:"#6366f1",fill:"#c7d2fe",name:"Enrollments"})]})}),e.jsx(c,{width:"100%",height:"100%",children:e.jsxs(C,{data:a.charts.revenueOverTime,children:[e.jsx(p,{strokeDasharray:"3 3",stroke:"#eef2ff"}),e.jsx(x,{dataKey:"bucket",tick:{fontSize:10},tickFormatter:s=>String(s).slice(0,10)}),e.jsx(m,{tickFormatter:s=>`₹${Number(s)/100}`}),e.jsx(h,{formatter:s=>l(s)}),e.jsx(k,{dataKey:"revenuePaise",fill:"#10b981",radius:[6,6,0,0]})]})})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 p-4 shadow-sm",children:[e.jsxs("h2",{className:"text-sm font-semibold text-gray-900 mb-3 flex items-center gap-2",children:[e.jsx(P,{size:16,className:"text-amber-500"})," Support"]}),e.jsxs("ul",{className:"text-sm space-y-2 text-gray-900",children:[e.jsxs("li",{children:["Open: ",e.jsx("strong",{children:a.support.open})]}),e.jsxs("li",{children:["In progress: ",e.jsx("strong",{children:a.support.inProgress})]}),e.jsxs("li",{children:["Trailing year total: ",e.jsx("strong",{children:a.support.trailingYearTotal})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 p-4 shadow-sm",children:[e.jsxs("h2",{className:"text-sm font-semibold text-gray-900 mb-3 flex items-center gap-2",children:[e.jsx(v,{size:16,className:"text-violet-500"})," AI (30d)"]}),e.jsxs("ul",{className:"text-sm space-y-2 text-gray-800",children:[e.jsxs("li",{children:["Estimated tokens: ",e.jsx("strong",{children:a.aiUsage30d.estimatedTokens.toLocaleString()})]}),e.jsxs("li",{children:["Cost (µUSD): ",e.jsx("strong",{children:a.aiUsage30d.costMicrousd.toLocaleString()})]}),e.jsxs("li",{children:["Calls: ",e.jsx("strong",{children:a.aiUsage30d.calls})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 p-4 shadow-sm",children:[e.jsxs("h2",{className:"text-sm font-semibold text-gray-900 mb-3 flex items-center gap-2",children:[e.jsx(L,{size:16,className:"text-sky-500"})," Batches & live"]}),e.jsxs("ul",{className:"text-sm space-y-2 text-gray-900",children:[e.jsxs("li",{children:["Cohort count: ",e.jsx("strong",{children:a.batches.cohortCount})]}),e.jsxs("li",{className:"flex items-center gap-1",children:[e.jsx(b,{size:14})," Upcoming live: ",e.jsx("strong",{children:a.liveClasses.upcoming})]}),e.jsxs("li",{children:["Past sessions (window): ",e.jsx("strong",{children:a.liveClasses.trailingPastSessions})]})]})]})]})]})})}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.