import{d as _,ez as w,J as h,b as k,c as C,w as m,f as d,u as O}from"./outputWidgets.65926c1d.js";import{e as x,b as I}from"./icons.da7d27cd.js";import{a as v}from"./asyncComputed.4723d9b8.js";import"./router.52af5430.js";import{O as l}from"./organization.18fdda34.js";import"./index.8b621348.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.b3bbd925.js";import{C as A}from"./CrudView.bb677fb8.js";import{B}from"./BaseLayout.7f35e98f.js";import{a as N}from"./ant-design.14676eb3.js";import"./Title.2cced18a.js";import"./index.553ada1f.js";import"./gateway.0e243f04.js";import"./activeRecord.994400e6.js";import"./pubsub.dc5bec39.js";import"./logo.084e5d7c.js";import"./index.2740d90e.js";import"./index.1bb9605d.js";import"./index.205aa6f9.js";import"./Form.47548ee6.js";import"./url.bc2b44ba.js";import"./index.0312767e.js";import"./index.006c6212.js";import"./index.73801d39.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="91f70905-64c0-41bb-980d-cc3d28cd9eab",a._sentryDebugIdIdentifier="sentry-dbid-91f70905-64c0-41bb-980d-cc3d28cd9eab")}catch{}})();const ot=_({__name:"Organizations",setup(a){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:g}=v(()=>l.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},f=async t=>{const o=await l.create(t.name);s({key:o.id})},b=async({key:t})=>{var e,c;await N("Are you sure you want to delete this organization?")&&(await((c=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:c.delete()),g())},y=h(()=>{var t,o;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(t=r.value)==null?void 0:t.map(e=>({key:e.id,cells:[{text:e.name,link:`/organizations/${encodeURIComponent(e.id)}`},{text:e.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?o:[]}});return(t,o)=>(k(),C(B,null,{navbar:m(()=>[d(D,{breadcrumb:n})]),content:m(()=>[d(A,{"entity-name":"organization",loading:O(u),title:"My organizations",description:"An organization is your company\u2019s account. Add co-workers, manage their access, organize projects and billing.","create-button-text":"Create Organization","empty-title":"No organizations here yet",table:y.value,fields:i,onCreate:f},null,8,["loading","table"])]),_:1}))}});export{ot as default};
//# sourceMappingURL=Organizations.61548986.js.map
