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.75a5b0b9.js";import{e as x,b as I}from"./icons.c04528be.js";import{a as v}from"./asyncComputed.c701d7b0.js";import"./console.3fb52eaf.js";import{O as p}from"./organization.98baeec7.js";import"./index.a131125e.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.debcdf1c.js";import{_ as A}from"./CrudView.vue_vue_type_script_setup_true_lang.ff628288.js";import{B}from"./BaseLayout.324568a0.js";import{a as N}from"./ant-design.7c6678de.js";import"./index.a1ee75ca.js";import"./Form.2c716183.js";import"./Title.b6c9692d.js";import"./index.b50eb903.js";import"./index.4598445f.js";import"./index.b6767512.js";import"./dayjs.d3366d83.js";import"./index.e24c456b.js";import"./index.7aacb57f.js";import"./TabPane.0d7849ee.js";import"./index.e9ba5796.js";import"./CollapsePanel.46ee4c6b.js";import"./index.3916405f.js";import"./index.5a67eb5f.js";import"./index.fe803cdf.js";import"./index.5e9c5434.js";import"./index.00d295c9.js";import"./index.fc88890c.js";import"./index.9c0809a0.js";import"./index.49e953af.js";import"./gateway.99e43695.js";import"./activeRecord.115270b9.js";import"./pubsub.3fa240d3.js";import"./logo.084e5d7c.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="caf02aae-a17d-4c9d-a578-1686848ed9c8",e._sentryDebugIdIdentifier="sentry-dbid-caf02aae-a17d-4c9d-a578-1686848ed9c8")}catch{}})();const lt=_({__name:"Organizations",setup(e){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 a=await p.create(t.name);s({key:a.id})},y=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())},b=h(()=>{var t,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(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:y,dangerous:!0}]}]})))!=null?a:[]}});return(t,a)=>(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:b.value,fields:n,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{lt as default};
//# sourceMappingURL=Organizations.1fb74170.js.map
