PageSourceSearch

https://local-it-partner.de/assets/_admin.admin.posts-DuwPoeKl.js

js local-it-partner.de collected 2026-10-07 04:59:52 UTC 2,340 bytes, 1 lines download raw bytes

1import{aN as N,ah as c,bh as b,j as e,d as o,G as h}from"./index-pmhrAKwR.js";import{d as v,l as B}from"./admin-posts.functions-3nQ8UdDW.js";import{B as i}from"./button-DSGBCc9A.js";import{B as x}from"./badge-BanEc-xe.js";import{T as y,a as w,b as a,c as r,d as T,e as t}from"./table-DCwpeJqO.js";import"./index-j-GkUALt.js";function P(){const m=N(),u=c(B),j=c(v),{data:n,isLoading:l,refetch:f}=b({queryKey:["admin-posts"],queryFn:()=>u()}),g=async(s,p)=>{if(confirm(`„${p}" wirklich löschen?`))try{await j({data:{id:s}}),h.success("Beitrag gelöscht"),f(),m.invalidate()}catch(d){h.error(d instanceof Error?d.message:"Fehler")}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Beiträge"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Blogartikel verwalten und veröffentlichen."})]}),e.jsx(i,{asChild:!0,children:e.jsx(o,{to:"/admin/posts/new",children:"Neuer Beitrag"})})]}),e.jsx("div",{className:"rounded-md border",children:e.jsxs(y,{children:[e.jsx(w,{children:e.jsxs(a,{children:[e.jsx(r,{children:"Titel"}),e.jsx(r,{children:"Slug"}),e.jsx(r,{children:"Status"}),e.jsx(r,{children:"Aktualisiert"}),e.jsx(r,{className:"text-right",children:"Aktionen"})]})}),e.jsxs(T,{children:[l&&e.jsx(a,{children:e.jsx(t,{colSpan:5,className:"text-center text-muted-foreground",children:"Lade…"})}),!l&&(n?.posts?.length??0)===0&&e.jsx(a,{children:e.jsx(t,{colSpan:5,className:"text-center text-muted-foreground",children:"Noch keine Beiträge."})}),n?.posts?.map(s=>e.jsxs(a,{children:[e.jsx(t,{className:"font-medium",children:s.title}),e.jsx(t,{className:"font-mono text-xs text-muted-foreground",children:s.slug}),e.jsx(t,{children:s.published?e.jsx(x,{children:"Veröffentlicht"}):e.jsx(x,{variant:"secondary",children:"Entwurf"})}),e.jsx(t,{className:"text-sm text-muted-foreground",children:new Date(s.updated_at).toLocaleDateString("de-DE")}),e.jsxs(t,{className:"text-right space-x-2",children:[e.jsx(i,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(o,{to:"/admin/posts/$id",params:{id:s.id},children:"Bearbeiten"})}),e.jsx(i,{variant:"ghost",size:"sm",onClick:()=>g(s.id,s.title),children:"Löschen"})]})]},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.