PageSourceSearch

https://player3.gg/assets/AdminEscalationsPage-D4YUoUXQ.js

js player3.gg collected 2026-10-05 03:11:10 UTC 12,761 bytes, 16 lines download raw bytes

1import{K as U,s as H,r as l,j as e,D as Q,e as Y,f as V,g as $,B as C,h as K,O as f,A as Z,Q as W,n as X,U as J,T as ee,a as se,k as u,V as te,b as ae,W as D,X as B,Y as R,Z as L,$ as n,p as re,a0 as ne,a1 as N,a2 as le,v as ie}from"./index-yLHt_u4B.js";import{C as de,a as ce,b as oe,c as xe,d as me}from"./card-n98V_NUp.js";import{T as ue,a as he,b as G,c as p,d as je,e as g}from"./table-BJrvWvjH.js";import{A as pe}from"./AdminDesktopOnlyNotice-q8d98kR9.js";import{g as ge,u as ve,a as be}from"./moderationEscalationsApi-BSaqnkA-.js";import{C as fe}from"./copy-C60wh-O-.js";import{L as Ne}from"./loader-circle-BL3re58_.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ye=U("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const _e=U("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const we=U("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]),Se={SYSTEMIC_ABUSE:"Systemic abuse",DATA_CORRUPTION:"Data corruption",GLOBAL_BAN_REQUEST:"Global ban request"},F={open:"bg-amber-500/15 text-amber-500 border-amber-500/30",in_review:"bg-blue-500/15 text-blue-400 border-blue-500/30",resolved:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",rejected:"bg-rose-500/15 text-rose-400 border-rose-500/30"};function Ce(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function Te({escalation:s,open:T,onOpenChange:i,onSuccess:A}){var m,I,O;const c=H(),[x,y]=l.useState("in_review"),[b,_]=l.useState(""),[h,d]=l.useState(!1),[k,w]=l.useState(null),S=async a=>{var t;try{await((t=navigator.clipboard)==null?void 0:t.writeText(a)),w(a),setTimeout(()=>w(j=>j===a?null:j),1500)}catch{N({title:"Could not copy",variant:"destructive"})}};l.useEffect(()=>{s&&(y(s.status==="open"?"in_review":s.status),_(s.admin_notes??""))},[s]);const o=async a=>{try{const t=await ge(a);window.open(t,"_blank","noopener,noreferrer")}catch(t){N({title:"Could not open attachment",description:t instanceof Error?t.message:"Unknown error",variant:"destructive"})}},E=async a=>{var t;try{await((t=navigator.clipboard)==null?void 0:t.writeText(a))}catch{}N({title:"Opening player management",description:"The player ID was copied so you can action the ban."}),i(!1),c("/admin/players")},r=async()=>{if(s){d(!0);try{await ve({escalation_id:s.id,status:x,admin_notes:b.trim()||null}),N({title:"Escalation updated"}),A(),i(!1)}catch(a){N({title:"Update failed",description:a instanceof Error?a.message:"Unknown error",variant:"destructive"})}finally{d(!1)}}};return s?e.jsx(Q,{open:T,onOpenChange:i,children:e.jsxs(Y,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:[e.jsxs(V,{children:[e.jsxs($,{className:"flex flex-wrap items-center gap-2 text-base",children:[e.jsx(C,{variant:"outline",className:"font-medium",children:Se[s.issue_category]??s.issue_category}),e.jsx(C,{variant:"outline",className:F[s.status]??"",children:s.status.replace("_"," ")})]}),e.jsx(K,{children:"Review the studio report and send a resolution back to the team."})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 rounded-lg border border-border/60 bg-muted/30 p-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Game"}),e.jsx("p",{className:"font-medium text-foreground",children:s.game_title??"Unknown"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Submitted by"}),e.jsx("p",{className:"font-medium text-foreground",children:((m=s.submitted_by_profile)==null?void 0:m.username)??s.submitter_username??s.submitted_by.slice(0,8)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Submitted"}),e.jsx("p",{className:"font-medium text-foreground",children:new Date(s.created_at).toLocaleStr
16ing()})]})]}),e.jsxs("div",{children:[e.jsx(f,{className:"text-xs text-muted-foreground",children:"Description"}),e.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words text-sm text-foreground",children:s.description})]}),((I=s.target_user_ids)==null?void 0:I.length)>0&&e.jsxs("div",{children:[e.jsx(f,{className:"text-xs text-muted-foreground",children:"Reported players"}),e.jsx("div",{className:"mt-2 space-y-2",children:s.target_user_ids.map(a=>{var M;const t=(M=s.target_profiles)==null?void 0:M.find(q=>q.id===a),j=(t==null?void 0:t.username)||(t==null?void 0:t.full_name)||"Unknown player",P=(t==null?void 0:t.email)||`${a.slice(0,8)}…`,z=(j||"?").slice(0,2).toUpperCase();return e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 bg-card px-3 py-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsxs(Z,{className:"h-9 w-9",children:[e.jsx(W,{src:(t==null?void 0:t.avatar_url)??void 0,alt:j}),e.jsx(X,{className:"text-xs",children:z})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:j}),e.jsx(C,{variant:"outline",className:t!=null&&t.is_banned?"bg-rose-500/15 text-rose-400 border-rose-500/30":"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",children:t!=null&&t.is_banned?"Banned":"Active"})]}),e.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:P})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[e.jsx(J,{children:e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsx(u,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>S(a),children:k===a?e.jsx(te,{className:"h-3.5 w-3.5"}):e.jsx(fe,{className:"h-3.5 w-3.5"})})}),e.jsx(ae,{children:"Copy player ID"})]})}),e.jsxs(u,{size:"sm",variant:"outline",onClick:()=>E(a),children:[e.jsx(ye,{className:"h-3.5 w-3.5 mr-1.5"}),t!=null&&t.is_banned?"Manage player":"Global ban"]})]})]},a)})})]}),((O=s.attachments)==null?void 0:O.length)>0&&e.jsxs("div",{children:[e.jsx(f,{className:"text-xs text-muted-foreground",children:"Evidence"}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:s.attachments.map(a=>e.jsxs("button",{type:"button",onClick:()=>o(a.path),className:"inline-flex items-center gap-2 rounded-md border border-border/60 bg-card px-2.5 py-1.5 text-xs hover:bg-accent/40 transition-colors",children:[e.jsx(we,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"max-w-[180px] truncate",children:a.name}),e.jsx("span",{className:"text-muted-foreground",children:Ce(a.size)})]},a.path))})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-border/60 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[e.jsx(_e,{className:"h-4 w-4 text-muted-foreground"}),"Resolution"]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(f,{htmlFor:"esc-status",className:"text-xs text-muted-foreground",children:"Status"}),e.jsxs(D,{value:x,onValueChange:a=>y(a),children:[e.jsx(B,{id:"esc-status",children:e.jsx(R,{})}),e.jsxs(L,{className:"bg-popover z-[300]",children:[e.jsx(n,{value:"in_review",children:"In review"}),e.jsx(n,{value:"resolved",children:"Resolved"}),e.jsx(n,{value:"rejected",children:"Rejected"})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(f,{htmlFor:"esc-notes",className:"text-xs text-muted-foreground",children:"Admin notes (visible to the studio)"}),e.jsx(re,{id:"esc-notes",value:b,onChange:a=>_(a.target.value),rows:4,maxLength:2e3,placeholder:"Explain the outcome and any action taken."}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[b.length," / 2000"]})]})]})]}),e.jsxs(ne,{children:[e.jsx(u,{variant:"ghost",onClick:()=>i(!1),disabled:h,children:"Cancel"}),e.jsxs(u,{onClick:r,disabled:h,children:[h&&e.jsx(Ne,{className:"h-4 w-4 mr-2 animate-spin"}),"Save update"]})]})]})}):null}const v=25,Ae={SYSTEMIC_ABUSE:"Systemic abuse",DATA_CORRUPTION:"Data corruption",GLOBAL_BAN_REQUEST:"Global ban request"};function Ie(){const[s,T]=l.useState("all"),[i,A]=l.useState("all"),[c,x]=l.useState(0),[y,b]=l.useState(null),[_,h]=l.useState(!1),{data:d,isLoading:k,refetch:w}=le({queryKey:["admin-escalations",s,i,c],queryFn:()=>be({status:s==="all"?void 0:s,issue_category:i==="all"?void 0:i,limit:v,offset:c}),refetchOnMount:"always",staleTime:0}),S=(d==null?void 0:d.rows)??[],o=(d==null?void 0:d.total)??0,E=r=>{b(r),h(!0)};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"lg:hidden",children:e.jsx(pe,{title:"Escalations on Desktop",message:"Reviewing studio escalations requires a desktop browser. Please switch to a larger screen to continue."})}),e.jsxs("div",{className:"hidden lg:block space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-display font-semibold text-foreground",children:"Platform Escalation Queue"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Review and resolve moderation escalations submitted by game studios."})]}),e.jsxs(de,{children:[e.jsxs(ce,{className:"flex flex-row items-start justify-between gap-4 space-y-0",children:[e.jsxs("div",{children:[e.jsx(oe,{className:"text-base",children:"Escalations"}),e.jsxs(xe,{children:[o," escalation",o===1?"":"s"," matching the current filters."]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(D,{value:s,onValueChange:r=>{T(r),x(0)},children:[e.jsx(B,{className:"w-[150px]",children:e.jsx(R,{})}),e.jsxs(L,{children:[e.jsx(n,{value:"all",children:"All statuses"}),e.jsx(n,{value:"open",children:"Open"}),e.jsx(n,{value:"in_review",children:"In review"}),e.jsx(n,{value:"resolved",children:"Resolved"}),e.jsx(n,{value:"rejected",children:"Rejected"})]})]}),e.jsxs(D,{value:i,onValueChange:r=>{A(r),x(0)},children:[e.jsx(B,{className:"w-[190px]",children:e.jsx(R,{})}),e.jsxs(L,{children:[e.jsx(n,{value:"all",children:"All categories"}),e.jsx(n,{value:"SYSTEMIC_ABUSE",children:"Systemic abuse"}),e.jsx(n,{value:"DATA_CORRUPTION",children:"Data corruption"}),e.jsx(n,{value:"GLOBAL_BAN_REQUEST",children:"Global ban request"})]})]})]})]}),e.jsxs(me,{children:[k?e.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((r,m)=>e.jsx(ie,{className:"h-12 rounded-md"},m))}):S.length===0?e.jsx("div",{className:"rounded-lg border border-dashed border-border py-12 text-center text-sm text-muted-foreground",children:"No escalations match these filters."}):e.jsxs(ue,{children:[e.jsx(he,{children:e.jsxs(G,{children:[e.jsx(p,{children:"Game"}),e.jsx(p,{children:"Category"}),e.jsx(p,{children:"Submitted by"}),e.jsx(p,{children:"Status"}),e.jsx(p,{children:"Date"}),e.jsx(p,{className:"text-right",children:"Actions"})]})}),e.jsx(je,{children:S.map(r=>{var m;return e.jsxs(G,{children:[e.jsx(g,{className:"font-medium",children:r.game_title??"Unknown game"}),e.jsx(g,{className:"text-sm text-muted-foreground",children:Ae[r.issue_category]??r.issue_category}),e.jsx(g,{className:"text-sm text-muted-foreground",children:((m=r.submitted_by_profile)==null?void 0:m.username)??r.submitter_username??r.submitted_by.slice(0,8)}),e.jsx(g,{children:e.jsx(C,{variant:"outline",className:F[r.status]??"",children:r.status.replace("_"," ")})}),e.jsx(g,{className:"text-sm text-muted-foreground",children:new Date(r.created_at).toLocaleDateString()}),e.jsx(g,{className:"text-right",children:e.jsx(u,{size:"sm",variant:"outline",onClick:()=>E(r),children:"Review"})})]},r.id)})})]}),o>v&&e.jsxs("div",{className:"flex items-center justify-between pt-4",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",c+1,"-",Math.min(c+v,o)," of ",o]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u,{size:"sm",variant:"outline",disabled:c===0,onClick:()=>x(r=>Math.max(0,r-v)),children:"Previous"}),e.jsx(u,{size:"sm",variant:"outline",disabled:c+v>=o,onClick:()=>x(r=>r+v),children:"Next"})]})]})]})]})]}),e.jsx(Te,{escalation:y,open:_,onOpenChange:h,onSuccess:()=>w()})]})}export{Ie 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.