import{d as _,ez as w,J as h,b as k,c as C,w as m,f as d,u as O}from"./outputWidgets.3f6d0550.js";import{e as x,b as I}from"./icons.51140278.js";import{a as v}from"./asyncComputed.bd80460e.js";import"./router.f2ffb037.js";import{O as l}from"./organization.4093a69d.js";import"./index.4a6147e4.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.7af81a64.js";import{C as A}from"./CrudView.7764d20a.js";import{B}from"./BaseLayout.18cbe6d3.js";import{a as N}from"./ant-design.003e27e5.js";import"./Title.d85134a2.js";import"./index.3719e3b6.js";import"./gateway.985e8615.js";import"./activeRecord.4331371e.js";import"./pubsub.0f07f3a4.js";import"./logo.084e5d7c.js";import"./index.eb4bb603.js";import"./index.dee2e461.js";import"./index.18a73dee.js";import"./Form.7ff4c526.js";import"./url.980858d4.js";import"./index.6a58cd86.js";import"./index.9fce520b.js";import"./index.4614c424.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]="c8cc9b5d-23de-45b4-817b-bad18995927b",a._sentryDebugIdIdentifier="sentry-dbid-c8cc9b5d-23de-45b4-817b-bad18995927b")}catch{}})();const ot=_({__name:"Organizations",setup(a){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:g}=v(()=>l.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},b=async t=>{const o=await l.create(t.name);s({key:o.id})},f=async({key:t})=>{var e,c;await N("Are you sure you want to delete this organization?")&&(await((c=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:c.delete()),g())},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:f,dangerous:!0}]}]})))!=null?o:[]}});return(t,o)=>(k(),C(B,null,{navbar:m(()=>[d(D,{breadcrumb:n})]),content:m(()=>[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:b},null,8,["loading","table"])]),_:1}))}});export{ot as default};
//# sourceMappingURL=Organizations.f866f986.js.map
