import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.0c4e4661.js";import{u as w,o as h}from"./icons.d6072388.js";import{a as x}from"./asyncComputed.5f444091.js";import"./router.6a327cd1.js";import{T as s}from"./tables.7aaf4f25.js";import"./index.29479f55.js";import{C as D}from"./CrudView.030e77ce.js";import{n as i}from"./string.a6a19f96.js";import"./FormItem.16053930.js";import"./hasIn.c776179d.js";import"./index.3ab3d6e8.js";import"./record.2fdce707.js";import"./pubsub.459a9503.js";import"./index.cf4c23b9.js";import"./Title.0df8cfae.js";import"./Text.fd757b8d.js";import"./Form.281f433b.js";import"./Modal.8e447860.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.bda1e74e.js";import"./url.f50daeb8.js";import"./index.b4057846.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]="1faa5cc7-a893-40a2-9563-dd1054a262fc",t._sentryDebugIdIdentifier="sentry-dbid-1faa5cc7-a893-40a2-9563-dd1054a262fc")}catch{}})();const X=y({__name:"Tables",setup(t){const o=g(),a=C().params.projectId,{loading:m,result:d,refetch:c}=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:"",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:a}}},{type:"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),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{X as default};
//# sourceMappingURL=Tables.534b7af7.js.map
