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.903ef13f.js";import{e as x,b as I}from"./icons.c6b9d5b7.js";import{a as v}from"./asyncComputed.c4e04ddf.js";import"./router.ddb32f08.js";import{O as l}from"./organization.3570e1df.js";import"./index.7a97ebf0.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.876e0b87.js";import{C as A}from"./CrudView.87fcb808.js";import{B}from"./BaseLayout.206b37c4.js";import{a as N}from"./ant-design.6476f34e.js";import"./Title.a0ce44ea.js";import"./index.e5fe38b8.js";import"./gateway.a6a9ad01.js";import"./activeRecord.55ed0790.js";import"./pubsub.c9a1cd12.js";import"./logo.084e5d7c.js";import"./index.038e0c5b.js";import"./index.ff825c04.js";import"./index.33a83bfb.js";import"./Form.49dc913d.js";import"./url.08ed6687.js";import"./index.c70ecf50.js";import"./index.d93d8aa2.js";import"./index.abf1ee4c.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]="0828c8bc-f304-41a8-9976-f2d92219f0aa",o._sentryDebugIdIdentifier="sentry-dbid-0828c8bc-f304-41a8-9976-f2d92219f0aa")}catch{}})();const et=_({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:f}=v(()=>l.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},g=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()),f())},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(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:g},null,8,["loading","table"])]),_:1}))}});export{et as default};
//# sourceMappingURL=Organizations.09c2d73f.js.map
