import{d as _,ez as w,J as h,b as k,c as O,w as c,f as p,u as C}from"./outputWidgets.17392370.js";import{e as x,b as I}from"./icons.baa5f07a.js";import{a as v}from"./asyncComputed.76849272.js";import"./console.9b12928f.js";import{O as d}from"./organization.33951447.js";import"./index.c5e8e3a4.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.a1d71624.js";import{_ as A}from"./CrudView.vue_vue_type_script_setup_true_lang.c4e89a02.js";import{B}from"./BaseLayout.b515a973.js";import{a as N}from"./ant-design.9c3ff8a2.js";import"./index.7c30bb7a.js";import"./Form.e398e550.js";import"./Title.bc3ff086.js";import"./CollapsePanel.853dbd0d.js";import"./index.2e2d3a0a.js";import"./index.ba0ff767.js";import"./index.84380f11.js";import"./dayjs.05e1ae11.js";import"./index.56ff0f0c.js";import"./index.bd94f307.js";import"./TabPane.25e9ccd4.js";import"./index.8aa7fba2.js";import"./index.50017ce4.js";import"./index.fffd13c2.js";import"./index.d2f4083e.js";import"./index.1fd97730.js";import"./index.3e3b85af.js";import"./index.18880d1b.js";import"./index.8c91651f.js";import"./index.8d8985c7.js";import"./gateway.ee06b706.js";import"./activeRecord.84b679f6.js";import"./pubsub.fc739490.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]="eb2e06e5-9dc8-4fd8-9893-752c2125e289",a._sentryDebugIdIdentifier="sentry-dbid-eb2e06e5-9dc8-4fd8-9893-752c2125e289")}catch{}})();const lt=_({__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(()=>d.list()),s=({key:t})=>{l.push({name:"organization",params:{organizationId:t}})},g=async t=>{const e=await d.create(t.name);s({key:e.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,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:y,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(k(),O(B,null,{navbar:c(()=>[p(D,{breadcrumb:i})]),content:c(()=>[p(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.6cb0c34e.js.map
