import{d as _,ey as w,H as h,b as k,c as C,w as c,f as d,u as O}from"./outputWidgets.9a4dffd5.js";import{e as x,b as I}from"./icons.d935dec9.js";import{a as v}from"./asyncComputed.947a021a.js";import"./router.e9c58c63.js";import{O as l}from"./organization.ab53ea01.js";import"./columns.2487afd8.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.abe838a3.js";import{C as A}from"./CrudView.32e9e362.js";import{B}from"./BaseLayout.a71d4fa9.js";import{a as N}from"./ant-design.edc4db28.js";import"./Title.72e90637.js";import"./index.a351ac5c.js";import"./gateway.a8fa6711.js";import"./activeRecord.6b2e89dc.js";import"./pubsub.25596209.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./index.0d204717.js";import"./index.0e22fd42.js";import"./index.c2be78ce.js";import"./Form.0ea0ca53.js";import"./url.152c5826.js";import"./index.c64df437.js";import"./index.c4327f7e.js";import"./index.d0b58c73.js";import"./index.3ecad98a.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]="df8138e7-1ebc-4e68-b9bd-7fe19ba6917d",a._sentryDebugIdIdentifier="sentry-dbid-df8138e7-1ebc-4e68-b9bd-7fe19ba6917d")}catch{}})();const nt=_({__name:"Organizations",setup(a){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 o=await l.create(t.name);s({key:o.id})},b=async({key:t})=>{var e,m;await N("Are you sure you want to delete this organization?")&&(await((m=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:m.delete()),f())},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: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:y.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{nt as default};
//# sourceMappingURL=Organizations.ceb823ae.js.map
