PageSourceSearch

https://submitme.app/assets/ArticlesAdminPage-BcL4SHAC.js

js submitme.app collected 2026-09-24 14:32:59 UTC 3,099 bytes, 1 lines download raw bytes

1import{b as d,d as x,f as m,j as e,H as o,F as u,L as h,av as i,e as g}from"./index-CkEqqj90.js";import{P as p}from"./plus-CzunDavf.js";import{G as j}from"./globe-DZ_92Sgd.js";import{P as y}from"./pencil-DCjJYxJ-.js";import{T as b}from"./trash-2-fN0gf1il.js";function f(){return g({queryKey:["admin-articles"],queryFn:()=>i.get("/articles").then(s=>s.data)})}function L(){const s=d(),r=x(),{data:a=[],isLoading:n}=f(),l=m({mutationFn:t=>i.delete(`/articles/${t}`),onSuccess:()=>r.invalidateQueries({queryKey:["admin-articles"]})});function c(t){confirm(`Delete "${t.title}"? This cannot be undone.`)&&l.mutate(t.id)}return e.jsxs(e.Fragment,{children:[e.jsx(o,{children:e.jsx("title",{children:"Articles — Admin"})}),e.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Learn to Query"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Articles published at submitme.app/learn"})]}),e.jsxs("button",{onClick:()=>s("/admin/articles/new"),className:"inline-flex items-center gap-2 bg-brand-600 hover:bg-brand-700 text-white text-sm font-medium px-4 py-2 rounded-lg transition-colors",children:[e.jsx(p,{className:"w-4 h-4"})," New article"]})]}),n?e.jsx("div",{className:"text-sm text-gray-400",children:"Loading…"}):a.length===0?e.jsxs("div",{className:"text-center py-20 text-gray-400",children:[e.jsx(u,{className:"w-8 h-8 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No articles yet."})]}):e.jsx("div",{className:"space-y-2",children:a.map(t=>e.jsxs("div",{className:"flex items-center justify-between bg-white border border-gray-200 rounded-xl px-5 py-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 truncate",children:t.title}),t.status==="published"?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 px-2 py-0.5 rounded-full",children:[e.jsx(j,{className:"w-3 h-3"})," Published"]}):e.jsx("span",{className:"text-xs font-medium text-gray-400 bg-gray-100 px-2 py-0.5 rounded-full",children:"Draft"})]}),e.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:["/learn/",t.slug," · updated ",new Date(t.updated_at).toLocaleDateString()]})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:[t.status==="published"&&e.jsx(h,{to:`/learn/${t.slug}`,target:"_blank",className:"text-xs text-gray-400 hover:text-brand-600 transition-colors",children:"View"}),e.jsx("button",{onClick:()=>s(`/admin/articles/${t.id}`),className:"p-1.5 text-gray-400 hover:text-gray-700 hover:bg-gray-100 rounded transition-colors",children:e.jsx(y,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>c(t),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors",children:e.jsx(b,{className:"w-4 h-4"})})]})]},t.id))})]})]})}export{L 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.