1import{q as m,r as l,s as a,j as s,ae as b,af as g}from"./index-DfXdkiJZ.js";const e={panel:"#121626",line:"#222842",ink:"#E8EAF2",sub:"#8A90A8",violet:"#7C5CFF",ok:"#22c55e",warn:"#f59e0b",crit:"#ef4444"};function h(){const{currentOrg:t}=m(),[o,c]=l.useState({controls:0,ready:0,drift:0,evidence:0,attestations:0,vendors:0});l.useEffect(()=>{t!=null&&t.id&&(async()=>{const[r,n,u,v,x,f]=await Promise.all([a.from("grc_control_status").select("id",{count:"exact",head:!0}).eq("org_id",t.id),a.from("grc_control_status").select("id",{count:"exact",head:!0}).eq("org_id",t.id).eq("status","ready"),a.from("grc_control_drift_events").select("id",{count:"exact",head:!0}).eq("org_id",t.id).eq("acknowledged",!1),a.from("grc_evidence").select("id",{count:"exact",head:!0}).eq("org_id",t.id),a.from("grc_policy_attestations").select("id",{count:"exact",head:!0}).eq("org_id",t.id).eq("attested",!0),a.from("vendors").select("id",{count:"exact",head:!0}).eq("org_id",t.id)]);c({controls:r.count||0,ready:n.count||0,drift:u.count||0,evidence:v.count||0,attestations:x.count||0,vendors:f.count||0})})()},[t==null?void 0:t.id]);const d=o.controls?Math.round(o.ready/o.controls*100):0,i=[{label:"Total Controls",value:o.controls,color:e.violet},{label:"Controls Ready",value:`${d}%`,color:e.ok},{label:"Unack Drift",value:o.drift,color:o.drift>0?e.crit:e.sub},{label:"Evidence Items",value:o.evidence,color:e.violet},{label:"Attestations",value:o.attestations,color:e.ok},{label:"Tracked Vendors",value:o.vendors,color:e.violet}];return s.jsxs("div",{className:"p-6 space-y-4",style:{backgroundColor:"#0B0E1A",minHeight:"100%",color:e.ink},children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"GRC Analytics"}),s.jsx("p",{className:"text-[12px]",style:{color:e.sub},children:"Cross-program metrics for executive review"})]}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:i.map(r=>s.jsx(b,{style:{backgroundColor:e.panel,borderColor:e.line,color:e.ink},children:s.jsxs(g,{className:"p-4",children:[s.jsx("div",{className:"text-[11px] uppercase tracking-wider",style:{color:e.sub},children:r.label}),s.jsx("div",{className:"text-2xl font-bold mt-2",style:{color:r.color},children:r.value})]})},r.label))})]})}export{h 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.