import{d as _,ez as w,J as h,b as k,c as O,w as c,f as p,u as C}from"./outputWidgets.c072fe4e.js";import{e as x,b as I}from"./icons.158b4825.js";import{a as v}from"./asyncComputed.376cdc00.js";import"./console.a87f2a82.js";import{O as d}from"./organization.09bd66c1.js";import"./index.90440471.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.b5ae2503.js";import{_ as A}from"./CrudView.vue_vue_type_script_setup_true_lang.9296340f.js";import{B}from"./BaseLayout.bdaed231.js";import{a as N}from"./ant-design.5cb2a38e.js";import"./index.00103e26.js";import"./Form.9f52866c.js";import"./Title.e3dcb8ea.js";import"./CollapsePanel.ecfd8c73.js";import"./index.d808811c.js";import"./index.ec8e038a.js";import"./index.dce83dc7.js";import"./dayjs.a56ae918.js";import"./index.4e6af937.js";import"./index.8ab39784.js";import"./TabPane.df5f41ca.js";import"./index.c5fd7926.js";import"./index.148bcdd7.js";import"./index.d9c3e0de.js";import"./index.e5a5efcd.js";import"./index.e7c5574b.js";import"./index.96de14c0.js";import"./index.28ce0851.js";import"./index.2e3640f1.js";import"./index.4cff163b.js";import"./gateway.18ca6e0a.js";import"./activeRecord.fdc25b97.js";import"./pubsub.98ad9fe0.js";import"./logo.084e5d7c.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="6dea8764-b13d-41c1-be5a-fea25bfcb233",a._sentryDebugIdIdentifier="sentry-dbid-6dea8764-b13d-41c1-be5a-fea25bfcb233")}catch{}})();const lt=_({__name:"Organizations",setup(a){const i=[{label:"My organizations",path:"/organizations"}],n=[{key:"name",label:"Organization Name"}],l=w(),{loading:u,result:r,refetch:f}=v(()=>d.list()),s=({key:t})=>{l.push({name:"organization",params:{organizationId:t}})},g=async t=>{const e=await d.create(t.name);s({key:e.id})},b=async({key:t})=>{var o,m;await N("Are you sure you want to delete this organization?")&&(await((m=(o=r.value)==null?void 0:o.find(z=>z.id===t))==null?void 0:m.delete()),f())},y=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(o=>({key:o.id,cells:[{text:o.name,link:`/organizations/${encodeURIComponent(o.id)}`},{text:o.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(k(),O(B,null,{navbar:c(()=>[p(D,{breadcrumb:i})]),content:c(()=>[p(A,{"entity-name":"organization",loading:C(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:n,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{lt as default};
//# sourceMappingURL=Organizations.8395facb.js.map
