1import{e as c,j as s}from"./index-DN3HURa4.js";import{u}from"./useQuery-DSTiDYUb.js";import{u as x}from"./useMutation-BWim-WOQ.js";import{u as t}from"./useServerFn-CBlGdxrC.js";import{b as p,c as f}from"./admin.functions-DsGZD3fj.js";import{B as h}from"./button-Bn4pXB9f.js";import{t as j}from"./index-CZY1ze68.js";import"./useBaseQuery-B2XjJFo9.js";const v=["admin","editor","author","reader"];function U(){const i=t(f),n=t(p),o=c(),{data:l,isLoading:d}=u({queryKey:["admin-users"],queryFn:()=>i()}),m=x({mutationFn:e=>n({data:e}),onSuccess:()=>{o.invalidateQueries({queryKey:["admin-users"]}),j.success("Updated")}});return s.jsxs("div",{children:[s.jsx("h3",{className:"font-serif text-xl mb-4",children:"Users"}),d?s.jsx("p",{className:"text-ink/50",children:"Loading..."}):s.jsx("div",{className:"border rounded-2xl divide-y",children:(l??[]).map(e=>s.jsxs("div",{className:"p-4 flex items-center gap-4 flex-wrap",children:[s.jsx("div",{className:"size-10 rounded-full bg-stone-200 overflow-hidden shrink-0",children:e.avatar_url&&s.jsx("img",{src:e.avatar_url,alt:"",className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium truncate",children:e.display_name}),s.jsxs("p",{className:"text-xs text-ink/50",children:["@",e.username]})]}),s.jsx("div",{className:"flex gap-1 flex-wrap",children:v.map(a=>{const r=e.roles.includes(a);return s.jsxs(h,{size:"sm",variant:r?"default":"outline",className:"text-xs h-7",onClick:()=>m.mutate({user_id:e.id,role:a}),children:[a,r?" â":""]},a)})})]},e.id))})]})}export{U 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.