import{d as _,ez as w,J as h,b as k,c as C,w as c,f as d,u as O}from"./outputWidgets.d94fff8c.js";import{e as x,b as I}from"./icons.fec42461.js";import{a as v}from"./asyncComputed.6da48dd7.js";import"./router.4a188c48.js";import{O as l}from"./organization.f12114ad.js";import"./index.a5166b6d.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.94933484.js";import{C as A}from"./CrudView.e6c5592c.js";import{B}from"./BaseLayout.f1c5ada3.js";import{a as N}from"./ant-design.b0e50c8b.js";import"./Title.c70c7e79.js";import"./index.3dad0da1.js";import"./gateway.8dd534ee.js";import"./activeRecord.4bb9e983.js";import"./pubsub.39314a92.js";import"./logo.084e5d7c.js";import"./index.7d7e00b1.js";import"./index.209f6c1c.js";import"./index.c81cf59e.js";import"./Form.57801503.js";import"./url.596d80c9.js";import"./index.e7f021ad.js";import"./index.3709b59d.js";import"./index.0f14f01f.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="662e7425-7a7a-43ae-9fe7-6b48cd0e083d",o._sentryDebugIdIdentifier="sentry-dbid-662e7425-7a7a-43ae-9fe7-6b48cd0e083d")}catch{}})();const ae=_({__name:"Organizations",setup(o){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:e})=>{p.push({name:"organization",params:{organizationId:e}})},f=async e=>{const a=await l.create(e.name);s({key:a.id})},y=async({key:e})=>{var t,m;await N("Are you sure you want to delete this organization?")&&(await((m=(t=r.value)==null?void 0:t.find(z=>z.id===e))==null?void 0:m.delete()),g())},b=h(()=>{var e,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=r.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.name,link:`/organizations/${encodeURIComponent(t.id)}`},{text:t.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:y,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(k(),C(B,null,{navbar:c(()=>[d(D,{breadcrumb:n})]),content:c(()=>[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:b.value,fields:i,onCreate:f},null,8,["loading","table"])]),_:1}))}});export{ae as default};
//# sourceMappingURL=Organizations.a5576c96.js.map
