1import{a as w,b as v,j as e}from"./index-CLD1fTwD.js";import{r as s}from"./vendor-react-ljcAK6JB.js";import{a as n}from"./adminApi-0ZcZbB9t.js";import"./vendor-charts-Bv_ia4lT.js";import"./vendor-sentry-C3XsaIN2.js";function C(){const{setPageInfo:l}=w(),{success:p,error:g}=v(),[f,c]=s.useState(null),[y,i]=s.useState(null),[o,b]=s.useState(null),[d,h]=s.useState(!0),[x,m]=s.useState(!1);s.useEffect(()=>{l("Platform health","Manual checks and reports")},[l]);const j=async()=>{try{h(!0);const[a,r]=await Promise.all([n.getSubscriptionHealth(),n.getSubscriptionInconsistencies(30)]);c(a.data),i(r.data)}catch{c(null),i(null)}finally{h(!1)}};s.useEffect(()=>{j()},[]);const N=async()=>{var a,r,u;try{m(!0);const t=await n.runHealthCheck();b(t.data),p("Health check completed")}catch(t){const S=t&&typeof t=="object"&&"response"in t?String((u=(r=(a=t.response)==null?void 0:a.data)==null?void 0:r.error)==null?void 0:u.message):"Failed";g(S)}finally{m(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-gray-900",children:"Platform health"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Subscription report, inconsistencies, manual health check"})]}),e.jsx("button",{type:"button",disabled:x,onClick:()=>void N(),className:"rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:x?"Runningâ¦":"Run health check"})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:"Subscription health summary"}),e.jsx("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:d?e.jsx("p",{className:"text-sm text-gray-600",children:"Loadingâ¦"}):e.jsx("pre",{className:"max-h-64 overflow-auto text-xs text-gray-500",children:JSON.stringify(f,null,2)})})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:"Subscription inconsistencies"}),e.jsx("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:d?e.jsx("p",{className:"text-sm text-gray-600",children:"Loadingâ¦"}):e.jsx("pre",{className:"max-h-64 overflow-auto text-xs text-gray-500",children:JSON.stringify(y,null,2)})})]}),o!=null&&e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:"Last manual check result"}),e.jsx("pre",{className:"max-h-64 overflow-auto rounded-xl border border-gray-200 bg-white p-4 text-xs text-gray-500",children:JSON.stringify(o,null,2)})]})]})}export{C 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.