import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.3c34606b.js";import{u as w,o as h}from"./icons.e6ec075a.js";import{a as x}from"./asyncComputed.8707f293.js";import"./router.56692652.js";import{T as s}from"./tables.47956951.js";import"./index.c3f2d302.js";import{C as D}from"./CrudView.7c2b0e6f.js";import{n as i}from"./string.33aa2b6f.js";import"./FormItem.895a8678.js";import"./hasIn.01f4de81.js";import"./index.dd5bce3f.js";import"./record.c46cf28f.js";import"./pubsub.28c1e0e3.js";import"./index.cf4c23b9.js";import"./Title.f4855332.js";import"./Text.aa4a1cf1.js";import"./Form.d74c49d4.js";import"./Modal.10b1f4fc.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.36eacc0b.js";import"./url.425cd9cb.js";import"./index.507e77a0.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]="62da8f16-e755-4ca9-983f-6f4204b7ca84",a._sentryDebugIdIdentifier="sentry-dbid-62da8f16-e755-4ca9-983f-6f4204b7ca84")}catch{}})();const X=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:"",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),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.d8759e24.js.map
