import{d as _,ez as w,J as h,b as k,c as O,w as c,f as d,u as C}from"./outputWidgets.d6897520.js";import{e as x,b as I}from"./icons.20b5fc8a.js";import{a as v}from"./asyncComputed.2c363ccc.js";import"./console.526446d9.js";import{O as p}from"./organization.1bd1ec32.js";import"./index.a8a303e6.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.206ffdeb.js";import{_ as A}from"./CrudView.vue_vue_type_script_setup_true_lang.eece189e.js";import{B}from"./BaseLayout.a0b2c3e1.js";import{a as N}from"./ant-design.25ee6641.js";import"./index.40bea6c2.js";import"./Form.a2bccbf0.js";import"./Title.9e102f51.js";import"./index.65fddafd.js";import"./index.dcf9fd0a.js";import"./index.09e1dc09.js";import"./dayjs.dccbdd6f.js";import"./index.0f5fc52a.js";import"./index.fd09b35e.js";import"./TabPane.c8258ec5.js";import"./index.b11f642a.js";import"./index.7c1a9101.js";import"./index.e63bacfa.js";import"./index.30191c77.js";import"./index.33e7eca5.js";import"./index.16598f32.js";import"./index.a2784b6b.js";import"./index.59123055.js";import"./gateway.c13063b9.js";import"./activeRecord.e97440b4.js";import"./pubsub.e0b33cd4.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]="edb638a4-09dd-4705-9758-72f0c8b43ab8",a._sentryDebugIdIdentifier="sentry-dbid-edb638a4-09dd-4705-9758-72f0c8b43ab8")}catch{}})();const dt=_({__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(()=>p.list()),s=({key:t})=>{l.push({name:"organization",params:{organizationId:t}})},g=async t=>{const e=await p.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(()=>[d(D,{breadcrumb:i})]),content:c(()=>[d(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{dt as default};
//# sourceMappingURL=Organizations.c1999bc5.js.map
