import{d as y,ey as g,ez as C,F as T,b as _,c as k,u as I}from"./outputWidgets.4b203988.js";import{u as w,o as h}from"./icons.b5300508.js";import{a as x}from"./asyncComputed.e3f401af.js";import"./router.b5e476b6.js";import"./jwt-decode.esm.74bd4619.js";import{T as s}from"./tables.a84c51fa.js";import"./index.7a3abf72.js";import{C as D}from"./CrudView.54167740.js";import{n as i}from"./string.ebbe001f.js";import"./FormItem.dacf5a0e.js";import"./hasIn.c2d80060.js";import"./storage.e938f042.js";import"./index.08241909.js";import"./record.3809e80c.js";import"./pubsub.3a2fa885.js";import"./index.cf4c23b9.js";import"./Title.aa160519.js";import"./Text.574763d2.js";import"./Form.ed264728.js";import"./Modal.96464eb7.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.0a96fdb4.js";import"./url.fcdccb50.js";import"./index.50465e1e.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]="2e6a4a9d-9c46-490f-a86c-6f5f2657fb66",a._sentryDebugIdIdentifier="sentry-dbid-2e6a4a9d-9c46-490f-a86c-6f5f2657fb66")}catch{}})();const Z=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:d,refetch:p}=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}})},u=T(()=>{var e,r;return{columns:[{name:"Table Name"},{name:"",align:"right"}],rows:(r=(e=d.value)==null?void 0:e.map(n=>({key:n.id,cells:[{type:"link",text:n.name,to:{name:"tableEditor",params:{tableId:n.id,projectId:t}}},{type:"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),p()}}]}]})))!=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:c},null,8,["loading","table"]))}});export{Z as default};
//# sourceMappingURL=Tables.b4ec7a2b.js.map
