1import{j as e}from"./app-C1iegf7Q.js";import{H as g,L as j,f as l}from"./inertia-BpyZy4w-.js";import{a as y}from"./admin-layout-BhXWbUlP.js";import{a as x}from"./utils-BiuKVCuu.js";import{F as f}from"./flag-CaFXrtTk.js";import{E as k}from"./eye-DoZffUO5.js";import{T as N}from"./trash-2-CrI9a2Po.js";import{f as v,p as w}from"./parseISO-DRj4ty2H.js";/* empty css */import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./createLucideIcon-wqc1LSWg.js";import"./info-D2ZN_yLm.js";import"./triangle-alert-C7AVwNi-.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./x-DQSeRCcH.js";import"./arrow-left-DCX0fhKH.js";import"./menu-BR3Nc3Gr.js";import"./users-BCcupCXV.js";import"./folder-open-I72SPUVk.js";import"./pound-sterling-D16GLaAZ.js";import"./book-open-DVFlG_9t.js";const _={pending:"bg-amber/12 text-amber-ink",reviewing:"bg-teal/10 text-teal",resolved:"bg-green/10 text-green-ink",dismissed:"bg-bg-2 text-ink-3"};function W({reports:s,stats:a,filters:n,issueTypes:d,statuses:i}){const c=t=>{l.get("/admin/content-reports",{...n,status:t},{preserveState:!0})},o=t=>{l.get("/admin/content-reports",{...n,type:t},{preserveState:!0})},m=t=>{confirm("Delete this report?")&&l.delete(`/admin/content-reports/${t}`,{preserveScroll:!0})},p=t=>{try{return v(w(t),"d MMM yyyy, HH:mm")}catch{return t}},b=t=>t.reportable?.title||t.reportable?.name||"Unknown",h=t=>t.reportable_type.includes("Resource")?"Resource":t.reportable_type.includes("ChecklistTemplate")?"Checklist":t.reportable_type.includes("Tool")?"Tool":"Unknown",r=t=>x("rounded-tag px-2.5 py-1 text-xs font-medium transition-colors",t?"bg-ink text-white":"bg-bg-2 text-ink-2 hover:bg-line");return e.jsxs(y,{children:[e.jsx(g,{title:"Content Reports · Admin"}),e.jsxs("div",{className:"px-4 py-5 sm:px-6 sm:py-7",children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("h1",{className:"text-xl font-semibold text-ink",children:"Content Reports"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Review and manage user-submitted content reports"})]}),e.jsx("div",{className:"mb-5 grid grid-cols-3 gap-3 sm:grid-cols-5",children:[{label:"Total",value:a.total},{label:"Pending",value:a.pending},{label:"Reviewing",value:a.reviewing},{label:"Resolved",value:a.resolved},{label:"Dismissed",value:a.dismissed}].map(t=>e.jsxs("div",{className:"rounded-card border border-line bg-white p-4",children:[e.jsx("p",{className:"text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:t.label}),e.jsx("p",{className:"mt-1.5 font-serif text-3xl leading-none text-ink",children:t.value})]},t.label))}),e.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsx("button",{type:"button",onClick:()=>c(null),className:r(!n.status),children:"All"}),Object.entries(i).map(([t,u])=>e.jsx("button",{type:"button",onClick:()=>c(t),className:r(n.status===t),children:u},t))]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsx("button",{type:"button",onClick:()=>o(null),className:r(!n.type),children:"All types"}),["resource","checklist","tool"].map(t=>e.jsxs("button",{type:"button",onClick:()=>o(t),className:r(n.type===t),children:[t.charAt(0).toUpperCase()+t.slice(1),"s"]},t))]})]}),e.jsxs("div",{className:"overflow-hidden rounded-card border border-line bg-white",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-line-2 bg-bg-2",children:[e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Content"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Issue"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Reporter"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Status"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Date"}),e.jsx("th",{className:"px-4 py-2.5 text-right text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Actions"})]})}),e.jsx("tbody",{children:s.data.length===0?e.jsx("tr",{children:e.jsxs("td",{colSpan:6,className:"py-12 text-center",children:[e.jsx(f,{className:"mx-auto mb-3 h-8 w-8 text-ink-3 op
1acity-50"}),e.jsx("p",{className:"text-sm text-ink-3",children:"No reports found"})]})}):s.data.map(t=>e.jsxs("tr",{className:"border-b border-line-2 last:border-0 hover:bg-bg-2",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("p",{className:"text-sm font-semibold text-ink",children:b(t)}),e.jsx("p",{className:"mt-0.5 text-xs text-ink-3",children:h(t)})]}),e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("span",{className:"rounded-tag bg-bg-2 px-2 py-0.5 text-2xs font-bold text-ink-2",children:d[t.issue_type]||t.issue_type}),e.jsx("p",{className:"mt-1 line-clamp-2 max-w-xs text-xs text-ink-3",children:t.description})]}),e.jsxs("td",{className:"px-4 py-3 text-sm",children:[e.jsx("p",{className:"text-ink-2",children:t.user?.name||"Unknown"}),t.user?.email&&e.jsx("p",{className:"mt-0.5 text-xs text-ink-3",children:t.user.email})]}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:x("rounded-tag px-2 py-0.5 text-2xs font-bold",_[t.status]??"bg-bg-2 text-ink-3"),children:i[t.status]||t.status})}),e.jsx("td",{className:"px-4 py-3 text-sm text-ink-3",children:p(t.created_at)}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex justify-end gap-1.5",children:[e.jsx(j,{href:`/admin/content-reports/${t.uuid}`,className:"flex h-7 w-7 items-center justify-center rounded-md border border-line bg-white text-ink-3 hover:bg-bg-2 hover:text-ink",children:e.jsx(k,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:()=>m(t.uuid),className:"flex h-7 w-7 items-center justify-center rounded-md border border-line bg-white text-ink-3 hover:border-red/30 hover:bg-red/10 hover:text-red",children:e.jsx(N,{className:"h-3.5 w-3.5"})})]})})]},t.id))})]})}),s.last_page>1&&e.jsxs("div",{className:"flex items-center justify-center gap-3 border-t border-line-2 px-4 py-3",children:[s.current_page>1&&e.jsx("button",{type:"button",onClick:()=>l.get("/admin/content-reports",{...n,page:s.current_page-1}),className:"text-xs font-medium text-ink-3 hover:text-ink",children:"Previous"}),e.jsxs("span",{className:"text-xs text-ink-3",children:["Page ",s.current_page," of ",s.last_page]}),s.current_page<s.last_page&&e.jsx("button",{type:"button",onClick:()=>l.get("/admin/content-reports",{...n,page:s.current_page+1}),className:"text-xs font-medium text-ink-3 hover:text-ink",children:"Next"})]})]})]})]})}export{W 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.