PageSourceSearch

https://myliveroom.com/assets/AdminMediaClaims-D_6Ohsh3.js

js myliveroom.com collected 2026-10-01 13:52:23 UTC 3,993 bytes, 1 lines download raw bytes

1import{a as k,r as i,j as t,l as f}from"./index-DT98fQox.js";import{A as z}from"./AdminLayout-uaaqYwvj.js";import"./admin-BijFdg4U.js";import"./markdown-CIel6SH6.js";import"./marked.esm-r2HKmrw_.js";const n={cyan:"var(--mlr-cyan, #00d4ff)",green:"#34d399",red:"#fb7185",purple:"#a855f7",text:"var(--mlr-text, #e2e8f0)",sub:"var(--mlr-text-muted, #94a3b8)",dim:"var(--mlr-text-dim, #64748b)",border:"1px solid var(--mlr-border, rgba(0,212,255,0.14))"},$=()=>{const{t:o}=k(),[d,l]=i.useState([]),[v,c]=i.useState(!0),[a,u]=i.useState(null),[x,p]=i.useState(null),[r,j]=i.useState("pending"),g=()=>{c(!0),f.get("/api/v1/admin/media-claims",{params:{status:r}}).then(({data:e})=>l(e?.data||[])).catch(()=>l([])).finally(()=>c(!1))};i.useEffect(g,[r]);const y=async(e,s)=>{u(e.id);try{const{data:m}=await f.post(`/api/v1/admin/media-claims/${e.id}/${s}`);p(m?.message||"Done."),r==="pending"?l(_=>_.filter(w=>w.id!==e.id)):g(),setTimeout(()=>p(null),3500)}catch(m){p(m?.response?.data?.message||"Something went wrong.")}finally{u(null)}},h=e=>({background:"transparent",color:e,fontSize:12,fontWeight:700,cursor:"pointer",border:`1px solid ${e}55`,borderRadius:999,padding:"6px 16px"}),b=e=>({color:e,fontSize:10,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",background:`${e}22`,borderRadius:999,padding:"2px 8px"}),S=e=>e==="approved"?n.green:e==="rejected"?n.red:n.cyan;return t.jsx(z,{title:o("admin.media_claims.title","Copyright Claims"),subtitle:o("admin.media_claims.subtitle","Users claiming a track or video is theirs. Approving reassigns ownership to the claimant and records an audit trail; it never happens automatically."),children:t.jsxs("div",{style:{maxWidth:1e3,margin:"0 auto",padding:"4px 0 60px"},children:[x&&t.jsx("div",{style:{color:n.green,fontSize:13,marginBottom:12},children:x}),t.jsx("div",{style:{display:"flex",gap:6,marginBottom:16},children:["pending","approved","rejected","all"].map(e=>t.jsx("button",{type:"button",onClick:()=>j(e),style:{background:"transparent",cursor:"pointer",border:"none",color:r===e?n.cyan:n.sub,fontSize:13,fontWeight:700,padding:"4px 2px",boxShadow:r===e?`inset 0 -2px 0 ${n.cyan}`:"none",textTransform:"capitalize"},children:e},e))}),v?t.jsx("div",{style:{color:n.dim,padding:"30px 0",textAlign:"center"},children:"Loading…"}):d.length===0?t.jsx("div",{style:{color:n.dim,padding:"30px 0",textAlign:"center"},children:o("admin.media_claims.empty","No claims here.")}):t.jsx("div",{style:{border:n.border,borderRadius:14,overflow:"hidden"},children:d.map((e,s)=>t.jsxs("div",{style:{padding:"14px 16px",background:s%2?"rgba(255,255,255,0.02)":"transparent",borderBottom:s<d.length-1?n.border:"none"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",marginBottom:6},children:[t.jsx("span",{style:b(S(e.status)),children:e.status}),e.media_type&&t.jsx("span",{style:b(n.purple),children:e.media_type}),t.jsx("span",{style:{color:n.text,fontWeight:700,fontSize:15},children:e.media_title||`Media #${e.media_item_id}`})]}),t.jsxs("div",{style:{color:n.sub,fontSize:13,marginBottom:e.reason?6:0},children:[t.jsxs("strong",{style:{color:n.text},children:["@",e.claimant_username||e.claimant_user_id]})," claims this, currently owned by ",t.jsxs("strong",{style:{color:n.text},children:["@",e.owner_username||e.owner_user_id]})]}),e.reason&&t.jsxs("div",{style:{color:n.text,fontSize:13,marginBottom:6,fontStyle:"italic"},children:["“",e.reason,"”"]}),e.evidence_url&&t.jsx("a",{href:e.evidence_url,target:"_blank",rel:"noreferrer",style:{color:n.cyan,fontSize:12},children:"Evidence ↗"}),e.status==="pending"&&t.jsxs("div",{style:{display:"flex",gap:8,marginTop:10},children:[t.jsx("button",{type:"button",disabled:a===e.id,style:h(n.green),onClick:()=>y(e,"approve"),children:a===e.id?"…":"Approve — reassign"}),t.jsx("button",{type:"button",disabled:a===e.id,style:h(n.red),onClick:()=>y(e,"reject"),children:a===e.id?"…":"Reject"})]})]},e.id))})]})})};export{$ 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.