import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.bf79c6b8.js";import{u as w,o as h}from"./icons.cf4b109d.js";import{a as x}from"./asyncComputed.42c5da60.js";import"./authorManager.09a2317d.js";import{T as s}from"./tables.d3cc925f.js";import"./index.1e489b02.js";import{C as D}from"./CrudView.255ead71.js";import{n as i}from"./string.62ff11a9.js";import"./record.fe4e890f.js";import"./pubsub.8fba7f4f.js";import"./gateway.8adee4a2.js";import"./index.cf4c23b9.js";import"./Title.1751190b.js";import"./Text.db5ef3fa.js";import"./FormItem.56138d9e.js";import"./hasIn.36ac051b.js";import"./Form.b42a9c68.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.fc0b8e07.js";import"./router.08175d4d.js";import"./index.e5b14e39.js";import"./url.379334d1.js";import"./index.934b837d.js";import"./index.bcfb1cc8.js";import"./index.9404929f.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]="f0d4157c-f2d0-4041-aad9-a4d154b29ca7",a._sentryDebugIdIdentifier="sentry-dbid-f0d4157c-f2d0-4041-aad9-a4d154b29ca7")}catch{}})();const $=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:d,refetch:c}=x(()=>s.list(t)),p=async e=>{const r=await s.create(t,e.name);o.push({name:"tableEditor",params:{tableId:r.id,projectId:t}})},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: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),c()}}]}]})))!=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(m),"docs-path":"tables/overview",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{$ as default};
//# sourceMappingURL=Tables.c9dfb162.js.map
