PageSourceSearch

https://muvitv.com/assets/admin.missing-D27v4Pdg.js

js muvitv.com collected 2026-10-02 11:26:42 UTC 5,206 bytes, 1 lines download raw bytes

1import{c as j,v as N,r as b,d as k,j as e,b as n,av as v,aw as y,ax as _,ay as w}from"./index-CVfxS1CQ.js";import{u as d}from"./useMutation-IaWaDbuu.js";import{B as o}from"./button-CBU6aRAX.js";import{c as M}from"./index-wHCK_piV.js";import{M as z}from"./map-pin-Ddd6aCWT.js";import{M as C}from"./mail-Dn1mEaL1.js";import{T as R}from"./trash-2-DcmCoGOl.js";const S=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],q=j("phone",S),A=[{key:"pending",label:"Awaiting review"},{key:"approved",label:"Published"},{key:"rejected",label:"Rejected"}];function u(s){if(!s)return"—";const a=new Date(s);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function K(){const s=N(),[a,r]=b.useState("pending"),{data:l=[],isLoading:p}=k({queryKey:["admin","missing-persons"],queryFn:()=>w()}),c=()=>{s.invalidateQueries({queryKey:["admin","missing-persons"]}),s.invalidateQueries({queryKey:["missing-persons"]})},x=d({mutationFn:t=>_({data:t}),onSuccess:()=>{n.success("Report updated"),c()},onError:t=>n.error(t.message)}),h=d({mutationFn:t=>y({data:t}),onSuccess:()=>{n.success("Case status updated"),c()},onError:t=>n.error(t.message)}),f=d({mutationFn:t=>v({data:{id:t}}),onSuccess:()=>{n.success("Report deleted"),c()},onError:t=>n.error(t.message)}),m=l.filter(t=>t.status===a),g=t=>l.filter(i=>i.status===t).length;return e.jsxs("div",{className:"mx-auto max-w-4xl",children:[e.jsxs("header",{className:"mb-6 border-b border-rule pb-4",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-ink-muted",children:"CMS"}),e.jsx("h1",{className:"mt-1 font-serif text-3xl font-bold tracking-tight",children:"Missing Persons"}),e.jsx("p",{className:"mt-2 text-sm text-ink-muted",children:"Review public submissions before they appear on the site."})]}),e.jsx("nav",{className:"mb-6 flex gap-1.5",children:A.map(t=>e.jsxs("button",{type:"button",onClick:()=>r(t.key),className:M("border px-3 py-1.5 text-[12px] font-medium",a===t.key?"border-ink bg-ink text-paper":"border-rule text-ink-muted hover:text-ink"),children:[t.label," (",g(t.key),")"]},t.key))}),p?e.jsx("p",{className:"text-sm text-ink-muted",children:"Loading…"}):m.length===0?e.jsx("p",{className:"text-sm text-ink-muted",children:"Nothing in this queue."}):e.jsx("ul",{className:"space-y-4",children:m.map(t=>e.jsx(F,{r:t,onStatus:i=>x.mutate({id:t.id,status:i}),onFound:i=>h.mutate({id:t.id,found:i}),onDelete:()=>{confirm(`Delete the report for "${t.full_name}"?`)&&f.mutate(t.id)}},t.id))})]})}function F({r:s,onStatus:a,onFound:r,onDelete:l}){return e.jsxs("li",{className:"flex flex-col gap-4 border border-rule p-4 sm:flex-row",children:[e.jsx("div",{className:"h-40 w-32 shrink-0 overflow-hidden rounded-lg border border-rule bg-surface",children:s.photo_url?e.jsx("img",{src:s.photo_url,alt:s.full_name,className:"size-full object-cover"}):e.jsx("div",{className:"flex size-full items-center justify-center text-[11px] text-ink-muted",children:"No photo"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-ink-muted",children:["Submitted ",u(s.created_at)," · ",s.status,s.is_found?" · found":""]}),e.jsxs("h2",{className:"font-serif text-xl font-semibold",children:[s.full_name,s.age!=null?e.jsxs("span",{className:"text-ink-muted",children:[", ",s.age]}):null,s.gender?e.jsxs("span",{className:"text-ink-muted",children:[" · ",s.gender]}):null]}),e.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-4 gap-y-1 text-[12px] text-ink-muted",children:[s.last_seen_location?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(z,{className:"size-3.5"})," ",s.last_seen_location]}):null,e.jsxs("span",{children:["Last seen ",u(s.last_seen_date)]}),s.contact_phone?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(q,{className:"size-3.5"})," ",s.contact_phone]}
1):null,s.contact_email?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(C,{className:"size-3.5"})," ",s.contact_email]}):null]}),e.jsx("p",{className:"mt-3 whitespace-pre-wrap text-[14px] leading-[1.55] text-ink-muted",children:s.description}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-1.5 border-t border-rule pt-3",children:[s.status!=="approved"&&e.jsx(o,{size:"sm",className:"rounded-none",onClick:()=>a("approved"),children:"Approve & publish"}),s.status!=="rejected"&&e.jsx(o,{size:"sm",variant:"outline",className:"rounded-none border-rule",onClick:()=>a("rejected"),children:"Reject"}),s.status!=="pending"&&e.jsx(o,{size:"sm",variant:"ghost",className:"rounded-none",onClick:()=>a("pending"),children:"Back to queue"}),e.jsx(o,{size:"sm",variant:"ghost",className:"rounded-none",onClick:()=>r(!s.is_found),children:s.is_found?"Mark as still missing":"Mark as found"}),e.jsx(o,{size:"sm",variant:"ghost",className:"rounded-none text-red",onClick:l,children:e.jsx(R,{className:"size-4"})})]})]})]})}export{K 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.