import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.781e41f9.js";import{u as w,o as h}from"./icons.0ffc383b.js";import{a as x}from"./asyncComputed.d06d5356.js";import"./authorManager.2805bec3.js";import{T as s}from"./tables.0492e59f.js";import"./index.fc2f40fb.js";import{C as D}from"./CrudView.331f38ea.js";import{n as i}from"./string.68e47d80.js";import"./record.71f43d7d.js";import"./pubsub.2273fc34.js";import"./index.cf4c23b9.js";import"./Title.bf1f8106.js";import"./Text.6168f33a.js";import"./FormItem.341ebdb6.js";import"./hasIn.205b6afa.js";import"./Form.a1506234.js";import"./Modal.3a32e945.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.942344e3.js";import"./router.2dba10c4.js";import"./index.db0f7a49.js";import"./url.a0d7eae0.js";import"./index.0ad8ad84.js";import"./index.574af34c.js";import"./index.b2c1bb4a.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[o]="f96f1499-177e-4366-8fb2-b127b453e06b",a._sentryDebugIdIdentifier="sentry-dbid-f96f1499-177e-4366-8fb2-b127b453e06b")}catch{}})();const $=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:p,refetch:d}=x(()=>s.list(t)),c=async e=>{const r=await s.create(t,e.name);o.push({name:"tableEditor",params:{tableId:r.id,projectId:t}})},b=T(()=>{var e,r;return{columns:[{name:"Table Name"},{name:"Actions",align:"right"}],rows:(r=(e=p.value)==null?void 0:e.map(n=>({key:n.id,cells:[{text:n.name,link:{name:"tableEditor",params:{tableId:n.id,projectId:t}}},{text:"Actions",actions:[{icon:w,label:"Edit Table",onClick({key:f}){o.push({name:"tableEditor",params:{tableId:f,projectId:t}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(t,n.id),d()}}]}]})))!=null?r:[]}}),u=[{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(m),"docs-path":"tables/overview",title:"Database Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:b.value,fields:u,"create-button-text":"Create Table",onCreate:c},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Tables.c13a457a.js.map
