import{d as _,eA as w,G as h,b as k,c as C,w as c,f as d,u as O}from"./outputWidgets.91878a00.js";import{e as x,d as I}from"./icons.842bb077.js";import{a as v}from"./asyncComputed.6ced1d7b.js";import"./router.77bfbaae.js";import"./index.8262a422.js";import{O as l}from"./organization.7073a119.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.2c29c19f.js";import{C as D}from"./CrudView.d6529c3b.js";import{B}from"./BaseLayout.7377c126.js";import{a as N}from"./ant-design.815cb8e3.js";import"./Base.80d71c98.js";import"./transButton.c9ea1045.js";import"./Text.24e27494.js";import"./Title.cb0c3b9b.js";import"./index.571df689.js";import"./record.8ded570d.js";import"./pubsub.862a9619.js";import"./gateway.6c51aaca.js";import"./logo.084e5d7c.js";import"./index.2b74a3c8.js";import"./url.dddb8fdb.js";import"./index.aed07cef.js";import"./index.43a9b125.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]="a34b8a1d-3c8e-4a5f-8662-512641194ba6",o._sentryDebugIdIdentifier="sentry-dbid-a34b8a1d-3c8e-4a5f-8662-512641194ba6")}catch{}})();const at=_({__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:t})=>{p.push({name:"organization",params:{organizationId:t}})},f=async t=>{const e=await l.create(t.name);s({key:e.id})},y=async({key:t})=>{var a,m;await N("Are you sure you want to delete this organization?")&&(await((m=(a=r.value)==null?void 0:a.find(z=>z.id===t))==null?void 0:m.delete()),g())},b=h(()=>{var t,e;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(e=(t=r.value)==null?void 0:t.map(a=>({key:a.id,cells:[{text:a.name,link:`/organizations/${encodeURIComponent(a.id)}`},{text:a.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:y,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(k(),C(B,null,{navbar:c(()=>[d(A,{breadcrumb:n})]),content:c(()=>[d(D,{"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{at as default};
//# sourceMappingURL=Organizations.694ec294.js.map
