import{d as y,ez as g,eA as C,G as T,b as _,c as k,u as I}from"./outputWidgets.6d6b4a37.js";import{e as w,g as h}from"./icons.28d0d847.js";import{a as x}from"./asyncComputed.17a6198d.js";import"./router.4e9df257.js";import{T as s,n as i}from"./tables.bfbe4e6c.js";import"./index.2cafcd9c.js";import{C as D}from"./CrudView.230a173f.js";import"./Form.1ff54ed5.js";import"./index.72c317ca.js";import"./record.7835c07e.js";import"./pubsub.7d377b25.js";import"./gateway.7a58b0c8.js";import"./index.0e216cc8.js";import"./Title.b41b4f96.js";import"./url.b5fbb423.js";import"./index.9eddb8ae.js";import"./index.6f6e8ffd.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="0cc69dfe-da73-450c-ba9c-9a146dc51a41",t._sentryDebugIdIdentifier="sentry-dbid-0cc69dfe-da73-450c-ba9c-9a146dc51a41")}catch{}})();const P=y({__name:"Tables",setup(t){const o=g(),a=C().params.projectId,{loading:c,result:d,refetch:m}=x(()=>s.list(a)),p=async e=>{const r=await s.create(a,e.name);o.push({name:"tableEditor",params:{tableId:r.id,projectId:a}})},u=T(()=>{var e,r;return{columns:[{name:"Table Name"},{name:"Actions",align:"right"}],rows:(r=(e=d.value)==null?void 0:e.map(n=>({key:n.id,cells:[{text:n.name,link:{name:"tableEditor",params:{tableId:n.id,projectId:a}}},{text:"Actions",actions:[{icon:w,label:"Edit Table",onClick({key:f}){o.push({name:"tableEditor",params:{tableId:f,projectId:a}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(a,n.id),m()}}]}]})))!=null?r:[]}}),b=[{key:"name",label:"Table name",type:"text",format:e=>i(e,!0),blur:e=>i(e,!1)}];return(e,r)=>(_(),k(D,{"entity-name":"table",loading:I(c),title:"Database Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:u.value,fields:b,"create-button-text":"Create Table",onCreate:p},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Tables.087b176e.js.map
