1import{j as e}from"./vendor-query-aCDArTG0.js";import{bX as j,B as o,bA as p,I as g,bw as b,bj as v,bu as m}from"./index-ClYGEEBZ.js";import{h as w,r as y}from"./vendor-react-K3X1LBKo.js";import{D as N}from"./DashboardLayout-fLKgt2H8.js";import{D as z}from"./DashboardPageHeader-CzO-r9fK.js";import{T as S,a as T,b as d,c as i,d as C,e as t}from"./table-BhBMZq4X.js";import{f as _,m as E}from"./useEntities-BDKqVkz6.js";import{P as I}from"./plus-DWtDlJ7I.js";import{E as D}from"./eye-BhUeb11K.js";import{P as k}from"./pencil-CK-88EV9.js";import{T as P}from"./trash-2-Bi6PNiFP.js";import"./vendor-supabase-Cyqq8y_p.js";import"./vendor-ui-WFBtqD0I.js";import"./vendor-editor-Ce38gZtn.js";import"./vendor-carousel-BMiz54g3.js";import"./stamp-DbdRZw2y.js";import"./menu-mILorbH5.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"18eeb2aeb53372160c9fd793b9a7ddaf2a0c4ad6"}}catch{}})();try{(function(){var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new a.Error().stack;
1n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="34286967-d1b5-4fdd-95a2-191450ec7018",a._sentryDebugIdIdentifier="sentry-dbid-34286967-d1b5-4fdd-95a2-191450ec7018")})()}catch{}function W(){const a=w(),{data:n,isLoading:u}=_(),x=E(),[l,h]=y.useState(""),c=(n||[]).filter(s=>s.nome.toLowerCase().includes(l.toLowerCase())),f=s=>{const r=s.page_content;return(r?.sections||(Array.isArray(r)?r:[])).length};return e.jsx(N,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsx(z,{title:"Servizi e Progetti",subtitle:"Gestisci i servizi e progetti",icon:e.jsx(j,{className:"h-5 w-5"}),action:e.jsxs(o,{onClick:()=>a("/dashboard/entita/servizi/new"),children:[e.jsx(I,{className:"h-4 w-4 mr-2"})," Nuovo Servizio"]})}),e.jsxs("div",{className:"relative max-w-sm",children:[e.jsx(p,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(g,{placeholder:"Cerca servizi...",value:l,onChange:s=>h(s.target.value),className:"pl-9"})]}),u?e.jsx("div",{className:"space-y-2",children:[1,2,3].map(s=>e.jsx(b,{className:"h-14 rounded"},s))}):e.jsxs(S,{children:[e.jsx(T,{children:e.jsxs(d,{children:[e.jsx(i,{className:"w-12",children:"Icona"}),e.jsx(i,{children:"Nome"}),e.jsx(i,{children:"Slug"}),e.jsx(i,{children:"Contenuti"}),e.jsx(i,{children:"Target"}),e.jsx(i,{children:"Ordine"}),e.jsx(i,{children:"Stato"}),e.jsx(i,{className:"w-32",children:"Azioni"})]})}),e.jsxs(C,{children:[c.map(s=>{const r=f(s);return e.jsxs(d,{children:[e.jsx(t,{children:s.icona_url?e.jsx(v,{value:s.icona_url,alt:s.nome,className:"w-8 h-8 text-foreground/70",imgClassName:"w-8 h-8 object-contain rounded"}):e.jsx("div",{className:"w-8 h-8 bg-muted rounded flex items-center justify-center text-xs text-muted-foreground",children:"â"})}),e.jsx(t,{className:"font-medium",children:s.nome}),e.jsx(t,{className:"text-muted-foreground",children:s.slug}),e.jsx(t,{children:r>0?e.jsxs(m,{variant:"secondary",className:"text-xs",children:[r," sez."]}):e.jsx("span",{className:"text-muted-foreground text-xs",children:"â"})}),e.jsx(t,{className:"text-sm text-muted-foreground truncate max-w-[200px]",children:s.target_audience||"â"}),e.jsx(t,{children:s.display_order}),e.jsx(t,{children:e.jsx(m,{variant:s.is_active?"default":"secondary",children:s.is_active?"Attivo":"Inattivo"})}),e.jsx(t,{children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx(o,{variant:"ghost",size:"icon",onClick:()=>window.open(`/progetti/${s.slug}`,"_blank"),title:"Preview",children:e.jsx(D,{className:"h-4 w-4"})}),e.jsx(o,{variant:"ghost",size:"icon",onClick:()=>a(`/dashboard/entita/servizi/edit/${s.id}`),children:e.jsx(k,{className:"h-4 w-4"})}),e.jsx(o,{variant:"ghost",size:"icon",onClick:()=>{confirm("Eliminare questo servizio?")&&x.mutate(s.id)},children:e.jsx(P,{className:"h-4 w-4 text-destructive"})})]})})]},s.id)}),c.length===0&&e.jsx(d,{children:e.jsx(t,{colSpan:8,className:"text-center text-muted-foreground",children:"Nessun servizio trovato"})})]})]})]})})}export{W as default}; 2//# sourceMappingURL=ServiziManager-lo1HCfmG.js.map
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.