1import{_ as v}from"./CLZXynAt.js";import{u as g}from"./DWyGiIbw.js";import{e as k,f as y,c as s,a as e,b as _,w as p,u as i,F as x,r as C,h as w,k as f,o as n,d as b,t as l,n as N,_ as z}from"./BwyH0Tw8.js";const B={class:"admin-page-header"},S={key:0,class:"py-4"},V={key:1,class:"admin-table"},q={class:"actions"},E=["onClick"],F={key:0},I=k({__name:"index",setup(L){const u=g(),r=f([]),d=f(!0);async function c(){d.value=!0;const{data:o}=await u.from("modernisthotel_camere").select("*").order("sort_order",{ascending:!0});r.value=o??[],d.value=!1}async function h(o){confirm("Sei sicuro di voler eliminare questa camera?")&&(await u.from("modernisthotel_camere").delete().eq("id",o),await c())}return y(c),(o,t)=>{const m=v;return n(),s("div",null,[e("div",B,[t[1]||(t[1]=e("h1",{class:"admin-title"},"Camere",-1)),_(m,{to:"/admin/camere/new",class:"btn-admin-action"},{default:p(()=>[...t[0]||(t[0]=[b("+ Nuova camera",-1)])]),_:1})]),i(d)?(n(),s("div",S,"Caricamento...")):(n(),s("table",V,[t[4]||(t[4]=e("thead",null,[e("tr",null,[e("th",null,"Ordine"),e("th",null,"Titolo"),e("th",null,"Slug"),e("th",null,"Pubblicato"),e("th",null,"Azioni")])],-1)),e("tbody",null,[(n(!0),s(x,null,C(i(r),a=>(n(),s("tr",{key:a.id},[e("td",null,l(a.sort_order),1),e("td",null,l(a.title),1),e("td",null,l(a.slug),1),e("td",null,[e("span",{class:N(a.is_published?"badge-published":"badge-draft")},l(a.is_published?"Pubblicato":"Bozza"),3)]),e("td",q,[_(m,{to:`/admin/camere/${a.id}`,class:"btn-edit"},{default:p(()=>[...t[2]||(t[2]=[b("Modifica",-1)])]),_:1},8,["to"]),e("button",{onClick:M=>h(a.id),class:"btn-delete"},"Elimina",8,E)])]))),128)),i(r).length===0?(n(),s("tr",F,[...t[3]||(t[3]=[e("td",{colspan:"5",class:"empty-row"},"Nessuna camera trovata",-1)])])):w("",!0)])]))])}}}),A=z(I,[["__scopeId","data-v-f8109e5a"]]);export{A 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.