1import{r as i,s as n,j as t}from"./index-BNrdOJig.js";import{B as h,D as l,E as c}from"./BackOfficeWorkspace-BsNQ8xko.js";function N(){const[r,o]=i.useState([]),[d,u]=i.useState([]),[s,x]=i.useState([]);i.useEffect(()=>{(async()=>{const{data:e}=await n.auth.getUser(),a=e.user?.id;if(!a)return;const[m,g,f]=await Promise.all([n.from("content_flags").select("id, entity_type, entity_id, flag_type, status, confidence, source, created_at").eq("entity_type","profile").eq("entity_id",a).order("created_at",{ascending:!1}).limit(50),n.from("moderation_incidents").select("id, kind, severity, status, source, created_at").eq("user_id",a).order("created_at",{ascending:!1}).limit(50),n.from("takedowns").select("id, asset_kind, status, created_at").eq("asset_owner_id",a).order("created_at",{ascending:!1}).limit(50)]);o(m.data??[]),u(g.data??[]),x(f.data??[])})()},[]);const p=s.filter(e=>e.status==="resolved"||e.status==="granted").length;return t.jsxs(h,{title:"Profile Defender",subtitle:"Impersonation, rip-off and takedown activity for your profile",intro:"We surface abuse signals against your account: content flags, moderation incidents, and takedown requests filed against your assets.",kpis:[{label:"Active flags",value:r.filter(e=>e.status==="open"||e.status==="pending").length},{label:"Incidents",value:d.length},{label:"Takedowns filed",value:s.length},{label:"Wins",value:p}],children:[t.jsx(l,{title:"Content flags",children:r.length===0?t.jsx(c,{title:"No flags against your profile",description:"Nothing suspicious flagged so far."}):t.jsx("ul",{className:"divide-y divide-white/5 text-sm",children:r.map(e=>t.jsxs("li",{className:"px-5 py-3 flex items-center gap-3",children:[t.jsx("span",{className:"text-xs uppercase tracking-wider px-2 py-0.5 rounded bg-primary/10 text-primary",children:e.flag_type}),t.jsxs("div",{className:"flex-1 text-muted-foreground",children:[e.source??"system"," · confidence ",e.confidence??"â"]}),t.jsx("span",{className:"text-xs",children:e.status}),t.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleDateString()})]},e.id))})}),t.jsx(l,{title:"Moderation incidents",children:d.length===0?t.jsx(c,{title:"No incidents",description:"No moderation incidents logged against your account."}):t.jsx("ul",{className:"divide-y divide-white/5 text-sm",children:d.map(e=>t.jsxs("li",{className:"px-5 py-3 flex items-center gap-3",children:[t.jsx("span",{className:"text-xs uppercase tracking-wider",children:e.kind}),t.jsxs("div",{className:"flex-1 text-muted-foreground",children:["severity ",e.severity??"â"," · ",e.source??"system"]}),t.jsx("span",{className:"text-xs",children:e.status}),t.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleDateString()})]},e.id))})}),t.jsx(l,{title:"Takedowns against your assets",children:s.length===0?t.jsx(c,{title:"No takedowns",description:"No takedown requests have been filed against your assets."}):t.jsx("ul",{className:"divide-y divide-white/5 text-sm",children:s.map(e=>t.jsxs("li",{className:"px-5 py-3 flex items-center gap-3",children:[t.jsx("span",{className:"text-xs uppercase tracking-wider",children:e.asset_kind}),t.jsxs("div",{className:"flex-1 text-muted-foreground",children:["#",e.id.slice(0,8)]}),t.jsx("span",{className:"text-xs",children:e.status}),t.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleDateString()})]},e.id))})})]})}export{N as component};
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.