import{d as _,ey as w,H as h,b as k,c as C,w as d,f as c,u as O}from"./outputWidgets.17e2270d.js";import{e as x,b as I}from"./icons.ae606380.js";import{a as v}from"./asyncComputed.c8589796.js";import"./router.845058a4.js";import{O as l}from"./organization.07df7fdd.js";import"./columns.1320dbbc.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.310b5ad5.js";import{C as A}from"./CrudView.0a7d7224.js";import{B}from"./BaseLayout.0fbdf4d1.js";import{a as N}from"./ant-design.8d97eacb.js";import"./Title.7b6ce571.js";import"./index.4787064b.js";import"./gateway.deb7dadd.js";import"./activeRecord.1230459a.js";import"./pubsub.52f6192d.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./index.23cb8791.js";import"./index.34b7172c.js";import"./index.038579df.js";import"./Form.0e9953f6.js";import"./url.6c73df07.js";import"./index.29151007.js";import"./index.4b3be88e.js";import"./index.cfd05648.js";import"./index.bedec2c6.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]="437ab64d-a57d-4797-9fab-0f076373db08",o._sentryDebugIdIdentifier="sentry-dbid-437ab64d-a57d-4797-9fab-0f076373db08")}catch{}})();const nt=_({__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})},b=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())},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(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:b,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(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:g},null,8,["loading","table"])]),_:1}))}});export{nt as default};
//# sourceMappingURL=Organizations.6ce2bddd.js.map
