import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.fdae7e91.js";import{o as w,l as h}from"./icons.59384d21.js";import{a as x}from"./asyncComputed.43537aae.js";import"./authorManager.adc33c37.js";import{T as s}from"./tables.8813d2e7.js";import"./index.30fe2a77.js";import{C as D}from"./CrudView.e3fe23cf.js";import{n as i}from"./string.65cdb72e.js";import"./record.f963a373.js";import"./pubsub.61789656.js";import"./gateway.8c35b4b8.js";import"./index.cf4c23b9.js";import"./Title.e4079793.js";import"./Text.2d7466b9.js";import"./FormItem.45b6065e.js";import"./hasIn.e6601643.js";import"./Form.d4070d32.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.ed9adb70.js";import"./router.ae435e74.js";import"./index.6f560850.js";import"./url.f60fbe92.js";import"./index.42add8ec.js";import"./index.9026b0b4.js";import"./index.a700463c.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]="49a90376-d885-45e4-bfff-aacc431e402c",a._sentryDebugIdIdentifier="sentry-dbid-49a90376-d885-45e4-bfff-aacc431e402c")}catch{}})();const $=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:c,refetch:d}=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=c.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:[]}}),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.80038965.js.map
