1import{e as o,j as e,L as l}from"./index-DN3HURa4.js";import{u as c}from"./useQuery-DSTiDYUb.js";import{u}from"./useMutation-BWim-WOQ.js";import{u as t}from"./useServerFn-CBlGdxrC.js";import{f as x,g as p}from"./admin.functions-DsGZD3fj.js";import{B as f}from"./button-Bn4pXB9f.js";import{B as h}from"./badge-3LDQAgSZ.js";import{t as j}from"./index-CZY1ze68.js";import{f as g}from"./formatDistanceToNow-Ctx6mZEP.js";import"./useBaseQuery-B2XjJFo9.js";function b(){const i=t(p),a=t(x),n=o(),{data:m,isLoading:r}=c({queryKey:["admin-comments"],queryFn:()=>i()}),d=u({mutationFn:s=>a({data:s}),onSuccess:()=>{n.invalidateQueries({queryKey:["admin-comments"]}),j.success("Updated")}});return e.jsxs("div",{children:[e.jsx("h3",{className:"font-serif text-xl mb-4",children:"Comments"}),r?e.jsx("p",{className:"text-ink/50",children:"Loading..."}):e.jsx("div",{className:"border rounded-2xl divide-y",children:(m??[]).map(s=>e.jsxs("div",{className:"p-4 flex gap-3 items-start",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 text-xs",children:[e.jsx("span",{className:"font-medium",children:s.author?.display_name}),e.jsx("span",{className:"text-ink/40",children:"on"}),e.jsx(l,{to:"/article/$slug",params:{slug:s.article?.slug??""},className:"text-accent hover:underline",children:s.article?.title}),e.jsxs("span",{className:"text-ink/40",children:["· ",g(new Date(s.created_at),{addSuffix:!0})]}),s.is_hidden&&e.jsx(h,{variant:"destructive",children:"Hidden"})]}),e.jsx("p",{className:"text-sm",children:s.content})]}),e.jsx(f,{size:"sm",variant:"outline",onClick:()=>d.mutate({id:s.id,hidden:!s.is_hidden}),children:s.is_hidden?"Show":"Hide"})]},s.id))})]})}export{b 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.