import{d as _,ez as w,J as h,b as k,c as C,w as d,f as c,u as O}from"./outputWidgets.b8e3fbc0.js";import{e as x,b as I}from"./icons.4de3900f.js";import{a as v}from"./asyncComputed.977b7d3a.js";import"./router.c0f681d7.js";import{O as l}from"./organization.872564db.js";import"./index.c28e38ab.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.725f8738.js";import{C as A}from"./CrudView.4bacc99a.js";import{B}from"./BaseLayout.8874d2af.js";import{a as N}from"./ant-design.589d9b06.js";import"./Title.b922ff42.js";import"./index.b9764f4b.js";import"./gateway.fb1f3fe6.js";import"./activeRecord.407da188.js";import"./pubsub.dbd75de9.js";import"./logo.084e5d7c.js";import"./index.364876d6.js";import"./index.5ca55868.js";import"./index.35048621.js";import"./Form.a05787d5.js";import"./url.e34f8e7c.js";import"./index.0e41e755.js";import"./index.4cd7b067.js";import"./index.2ea342e8.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]="eb1115d7-8f10-41e3-8e1e-a0a36bd7d9ba",o._sentryDebugIdIdentifier="sentry-dbid-eb1115d7-8f10-41e3-8e1e-a0a36bd7d9ba")}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})},b=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())},y=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:b,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(k(),C(B,null,{navbar:d(()=>[c(D,{breadcrumb:n})]),content:d(()=>[c(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{ae as default};
//# sourceMappingURL=Organizations.d054c53c.js.map
