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.8be138ba.js";import{e as x,b as I}from"./icons.35976e57.js";import{a as v}from"./asyncComputed.96c9ad3b.js";import"./router.bb47648a.js";import{O as l}from"./organization.f7d7229f.js";import"./columns.5510282a.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.43399a7a.js";import{C as A}from"./CrudView.cfa43f1a.js";import{B}from"./BaseLayout.7e0231be.js";import{a as N}from"./ant-design.e9f581dc.js";import"./Title.12e8916a.js";import"./index.0df733bd.js";import"./gateway.93fa1934.js";import"./activeRecord.f6cce158.js";import"./pubsub.e324f67c.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./index.98827a3d.js";import"./index.568a8efe.js";import"./index.7e655723.js";import"./Form.7b75db7b.js";import"./url.ebe1e528.js";import"./index.3ef3e2d2.js";import"./index.bc7e7ec9.js";import"./index.d11a75f6.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]="29ecc9db-5161-4523-952f-194a3f638bdd",a._sentryDebugIdIdentifier="sentry-dbid-29ecc9db-5161-4523-952f-194a3f638bdd")}catch{}})();const at=_({__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})},y=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())},b=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:y,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:b.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{at as default};
//# sourceMappingURL=Organizations.1d003b57.js.map
