PageSourceSearch

https://melodygenie.app/assets/FeatsReportsQueue-BIt1A4IO.js

js melodygenie.app collected 2026-10-04 16:29:26 UTC 5,973 bytes, 1 lines download raw bytes

1import{g as n,j as e,Z as T,Q as E}from"./index-CEq6EAUz.js";import{S as C}from"./shield-check-DoWUAbzx.js";import{B as F}from"./bot-D0dJJ1lY.js";import{F as O}from"./flag-AfaA26Lf.js";import{T as $}from"./triangle-alert-CM7M4O_7.js";const z=[["open","Open"],["reviewing","Reviewing"],["actioned","Actioned"],["dismissed","Dismissed"],["all","All"]],L={harassment:"Harassment",hate:"Hate or slurs",sexual:"Sexual content",minor_safety:"Child safety",threat:"Threats or violence",personal_data:"Private information",spam:"Spam or scam",other:"Other"},b=t=>t?new Date(t).toLocaleString():"—";async function A(t,l){const i=await E(),c=await fetch(`/api/admin/feats-reports${t}`,{method:l?"POST":"GET",headers:{...i?{Authorization:`Bearer ${i}`}:{},...l?{"Content-Type":"application/json"}:{}},body:l?JSON.stringify(l):void 0}),a=await c.json().catch(()=>({}));if(!c.ok)throw new Error(a.error||"Request failed");return a}function B({data:t}){if(!t||typeof t!="object")return null;const l=Array.isArray(t.messages)?t.messages:[],i=t.contributions||{},c=[["Topics",Array.isArray(i.topics)?i.topics.join(" · "):i.topics],["Music style",i.style],["Verse",i.phrase],["Twists",Array.isArray(i.twists)?i.twists.join(" · "):i.twists]].filter(([,a])=>a);return e.jsxs("div",{className:"fq-evidence",children:[e.jsxs("p",{className:"fo-muted",children:["Room “",String(t.room_name||"unnamed"),"” · ",String(t.visibility||"unknown")," · captured ",b(t.captured_at)]}),t.blocked_text&&e.jsxs("p",{className:"fq-blocked",children:[e.jsx($,{size:15,"aria-hidden":"true"})," Text the gate refused: ",e.jsx("q",{children:String(t.blocked_text)})]}),!!c.length&&e.jsx("ul",{className:"fq-messages",children:c.map(([a,h])=>e.jsxs("li",{children:[e.jsx("strong",{children:a}),e.jsx("span",{children:String(h)})]},a))}),!!l.length&&e.jsx("ul",{className:"fq-messages",children:l.map((a,h)=>e.jsxs("li",{children:[e.jsx("strong",{children:String(a.name||"unknown")}),e.jsx("span",{children:String(a.text||"")})]},a.id||h))}),!l.length&&!c.length&&!t.blocked_text&&e.jsx("p",{className:"fo-muted",children:"No text was captured."})]})}function Q(){const[t,l]=n.useState("open"),[i,c]=n.useState([]),[a,h]=n.useState(null),[x,y]=n.useState(!1),[S,d]=n.useState(""),[_,k]=n.useState(""),[p,R]=n.useState(null),[j,g]=n.useState(""),[N,q]=n.useState(""),m=n.useRef(0),o=n.useRef(!0);n.useEffect(()=>(o.current=!0,()=>{o.current=!1,m.current+=1}),[]);const f=n.useCallback(async s=>{const r=++m.current;y(!0),d("");try{const u=await A(`?status=${encodeURIComponent(s)}`);if(r!==m.current||!o.current)return;c(u.reports||[]),h(u.totals||null)}catch(u){r===m.current&&o.current&&d(u.message)}finally{r===m.current&&o.current&&y(!1)}},[]);n.useEffect(()=>{f(t)},[t,f]);async function v(s,r){if(["actioned","dismissed"].includes(r)&&j.trim().length<5){d("Write why you are closing it.");return}q(r),d(""),k("");try{if(await A("",{id:s,status:r,note:j.trim()||void 0}),!o.current)return;k(`Case marked ${r}.`),g(""),R(null),await f(t)}catch(u){o.current&&d(u.message)}finally{o.current&&q("")}}return e.jsxs("section",{className:"feats-ops fq","aria-labelledby":"fq-title",children:[e.jsxs("header",{className:"fo-header",children:[e.jsxs("div",{children:[e.jsx("p",{className:"fo-kicker",children:"MODERATION"}),e.jsx("h2",{id:"fq-title",children:"Feats reports"})]}),e.jsxs("span",{className:"fo-badge",children:[e.jsx(C,{size:16,"aria-hidden":"true"})," Human review · nothing is automatic"]})]}),e.jsxs("div",{className:"fq-filters",role:"group","aria-label":"Filter by status",children:[z.map(([s,r])=>e.jsxs("button",{className:s===t?"fo-primary":"","aria-pressed":s===t,onClick:()=>l(s),children:[r,a&&s!=="all"?` ${a[s]??0}`:""]},s)),e.jsx("button",{"aria-label":"Refresh",title:"Refresh",disabled:x,onClick:()=>f(t),children:e.jsx(T,{size:17,"aria-hidden":"true"})})]}),S&&e.jsx("p",{role:"alert",className:"fo-error",children:S}),_&&e.jsxs("p",{role:"status",className:"fo-success",children:[e.jsx(C,{size:17,"aria-hidden":"true"}),_]}),x&&e.jsx("p",{role:"status",children:"Loading reports…"}),!x&&!i.length&&e.jsx("p",{className:"fo-muted",children:"Nothing here. That is the good outcome."}),e.jsx("ul",{className:"fq-list",children:i.map(s=>e.jsxs("li",{children:[e.jsxs("div",{className:"fq-head",children:[e.jsxs("div",{children:[e.jsx("strong",{children:L[s.reason]||s.reason}),e.jsxs("span",{className:"fo-muted",children:[s.source==="auto"?e.jsxs(e.Fragment,{children:[e.jsx(F,{size:13,"aria-hidden":"true"})," Content gate"]}):e.jsxs(e.Fragment,{children:[e.jsx(O,{size:13,"aria-hidden":"true"})," ",s.reporter_name||"a player"]})," · ","against ",s.reported_name||s.reported_user_id||"the room",s.reported_total>1&&e.jsxs("b",{className:"fq-repeat",children:[" ",s.reported_total," cases"]})," · ",b(s.created_at)]})]}),e.jsx("button",{onClick:()=>{R(p===s.id?null:s.id),g(""),d("")},"aria-expanded":p===s.id,children:p===s.id?"Close":"Review"})]}),s.detail&&e.jsxs("p",{className:"fq-detail",children:["“",s.detail,"”"]}),s.status!=="open"&&e.jsxs("p",{className:"fo-muted",children:[s.status," by ",s.reviewer_name||"admin"," · ",b(s.reviewed_at),s.review_note?` · ${s.review_note}`:""]}),p===s.id&&e.jsxs("div",{className:"fq-panel",children:[e.jsx(B,{data:s.evidence}),e.jsx("label",{htmlFor:`note-${s.id}`,children:"Why you are closing it"}),e.jsx("textarea",{id:`note-${s.id}`,rows:3,maxLength:1e3,value:j,onChange:r=>g(r.target.value)}),e.jsxs("div",{className:"fo-dialog-actions",children:[e.jsx("button",{disabled:!!N,onClick:()=>v(s.id,"reviewing"),children:"Looking into it"}),e.jsx("button",{disabled:!!N,onClick:()=>v(s.id,"dismissed"),children:"Dismiss"}),e.jsx("button",{className:"fo-primary",disabled:!!N,onClick:()=>v(s.id,"actioned"),children:"Acted on it"})]}),e.jsx("p",{className:"fo-muted",children:"Marking it acted on records the decision. Removing the account is still a separate, deliberate step."})]})]},s.id))})]})}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.