PageSourceSearch

https://www.studiolegalemeiffret.it/assets/admin.index-CPBL9Tav.js

js studiolegalemeiffret.it collected 2026-10-08 07:14:38 UTC 3,729 bytes, 1 lines download raw bytes

1import{e as j,f as b,r as N,j as e,L as a,t as i,h as v,i as y,k as w}from"./index-CmMupkCO.js";import{u as r}from"./useServerFn-CPQTZIj6.js";import{u as C,a as c}from"./useMutation-uetX_lH9.js";import"./useBaseQuery-Cv6YT9kK.js";function k(){const o=j(),x=r(w),m=r(y),u=r(v),h=b.useNavigate(),[s,p]=N.useState(""),{data:l,isLoading:g}=C({queryKey:["admin-articles"],queryFn:()=>x()}),f=c({mutationFn:t=>m({data:{id:t}}),onSuccess:()=>{i.success("Articolo eliminato"),o.invalidateQueries({queryKey:["admin-articles"]})}}),n=c({mutationFn:t=>u({data:{id:t}}),onSuccess:t=>{i.success("Bozza creata"),o.invalidateQueries({queryKey:["admin-articles"]}),t?.id&&h({to:"/admin/articoli/$id",params:{id:t.id}})},onError:t=>i.error(t instanceof Error?t.message:"Errore")}),d=(l??[]).filter(t=>t.title.toLowerCase().includes(s.toLowerCase())||t.slug.toLowerCase().includes(s.toLowerCase()));return e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4 mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-serif text-3xl text-navy",children:"Articoli"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[l?.length??0," totali"]})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx(a,{to:"/admin/articoli/nuovo",className:"bg-navy text-cream px-4 py-2 text-xs font-semibold uppercase tracking-wider hover:bg-navy-deep",children:"+ Nuovo articolo"})})]}),e.jsx("input",{placeholder:"Cerca per titolo o slug...",value:s,onChange:t=>p(t.target.value),className:"w-full md:w-80 border border-border bg-white px-3 py-2 text-sm mb-4 focus:outline-none focus:ring-2 focus:ring-gold"}),g?e.jsx("p",{className:"text-muted-foreground",children:"Caricamento..."}):e.jsx("div",{className:"bg-white border border-border",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/50 text-xs uppercase tracking-wider text-navy",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left p-3",children:"Titolo"}),e.jsx("th",{className:"text-left p-3",children:"Stato"}),e.jsx("th",{className:"text-left p-3",children:"Categoria"}),e.jsx("th",{className:"text-left p-3",children:"Aggiornato"}),e.jsx("th",{className:"text-right p-3",children:"Azioni"})]})}),e.jsxs("tbody",{children:[d.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"p-8 text-center text-muted-foreground",children:"Nessun articolo. Crea il primo articolo."})}),d.map(t=>e.jsxs("tr",{className:"border-t border-border hover:bg-muted/30",children:[e.jsxs("td",{className:"p-3",children:[e.jsx(a,{to:"/admin/articoli/$id",params:{id:t.id},className:"text-navy hover:text-gold font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:t.slug})]}),e.jsx("td",{className:"p-3",children:e.jsx("span",{className:`text-xs px-2 py-1 ${t.status==="published"?"bg-gold/20 text-navy":"bg-muted text-muted-foreground"}`,children:t.status==="published"?"Pubblicato":"Bozza"})}),e.jsx("td",{className:"p-3 text-muted-foreground",children:t.category?.name??"—"}),e.jsx("td",{className:"p-3 text-xs text-muted-foreground",children:new Date(t.updated_at).toLocaleDateString("it-IT")}),e.jsxs("td",{className:"p-3 text-right",children:[e.jsx(a,{to:"/admin/articoli/$id",params:{id:t.id},className:"text-xs text-navy hover:text-gold mr-3",children:"Modifica"}),e.jsx("button",{onClick:()=>n.mutate(t.id),disabled:n.isPending,className:"text-xs text-navy hover:text-gold mr-3 disabled:opacity-50",children:"Duplica"}),e.jsx("button",{onClick:()=>{confirm(`Eliminare "${t.title}"?`)&&f.mutate(t.id)},className:"text-xs text-destructive hover:underline",children:"Elimina"})]})]},t.id))]})]})})]})}export{k 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.