1import{o as m,g as a,Q as x,T as p,u,j as e,L as b,t as n}from"./index-CHfAEzh6.js";import{u as h}from"./useQuery-BNbnznBU.js";import{P as g}from"./plus-Cc8jWbOu.js";import{P as f}from"./pen-line-uUXbqSEW.js";import{T as j}from"./trash-2-Ch328BbP.js";import"./useBaseQuery-Bttx1P4P.js";function P(){const i=m(),r=a(x),o=a(p),l=u(),t=h({queryKey:["admin","blog"],queryFn:()=>r()});async function c(s){if(confirm("Diesen Beitrag wirklich löschen?"))try{await o({data:{id:s}}),n.success("Gelöscht."),i.invalidateQueries({queryKey:["admin","blog"]})}catch(d){n.error(d.message)}}return e.jsxs("section",{children:[e.jsxs("div",{className:"mb-8 flex items-end justify-between",children:[e.jsxs("h1",{className:"font-display text-4xl font-extrabold uppercase text-bone",children:["Blog",e.jsx("span",{className:"text-plum-soft",children:"."})]}),e.jsxs("button",{onClick:()=>l({to:"/admin/blog/$id",params:{id:"new"}}),className:"inline-flex items-center gap-2 bg-plum-soft px-5 py-3 text-xs font-bold uppercase tracking-widest text-aubergine-deep hover:bg-bone",children:[e.jsx(g,{className:"h-4 w-4"})," Neuer Beitrag"]})]}),t.isLoading&&e.jsx("p",{className:"text-sm text-bone/60",children:"Ladeâ¦"}),t.data&&t.data.posts.length===0&&e.jsx("p",{className:"border-2 border-plum/30 px-6 py-12 text-center text-sm text-bone/60",children:"Noch keine Beiträge."}),e.jsx("div",{className:"border-y-2 border-plum/30",children:t.data?.posts.map(s=>e.jsxs("div",{className:"grid grid-cols-12 items-center gap-4 border-b border-plum/15 py-4",children:[e.jsxs("div",{className:"col-span-5",children:[e.jsx("p",{className:"font-display font-bold uppercase text-bone",children:s.title}),e.jsxs("p",{className:"text-[11px] text-bone/50",children:["/",s.slug]})]}),e.jsx("div",{className:"col-span-2 text-[11px] uppercase tracking-widest text-bone/60",children:s.category?.name??"â"}),e.jsx("div",{className:"col-span-2 text-[11px] uppercase tracking-widest",children:s.status==="published"?e.jsx("span",{className:"bg-plum-soft/30 px-2 py-1 text-plum-soft",children:"veröffentlicht"}):e.jsx("span",{className:"bg-bone/10 px-2 py-1 text-bone/60",children:"Entwurf"})}),e.jsx("div",{className:"col-span-1 font-mono text-[10px] text-bone/50",children:new Date(s.updated_at).toLocaleDateString("de-DE")}),e.jsxs("div",{className:"col-span-2 flex justify-end gap-2",children:[e.jsx(b,{to:"/admin/blog/$id",params:{id:s.id},className:"p-2 hover:bg-plum-soft/30 text-bone",children:e.jsx(f,{className:"h-4 w-4"})}),e.jsx("button",{onClick:()=>c(s.id),className:"p-2 hover:bg-destructive hover:text-cream text-bone",children:e.jsx(j,{className:"h-4 w-4"})})]})]},s.id))})]})}export{P 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.