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.1f391ab3.js";import{e as x,b as I}from"./icons.35fd2af6.js";import{a as v}from"./asyncComputed.56fb497e.js";import"./console.3edc9cde.js";import{O as p}from"./organization.390058ee.js";import"./index.e8fb5940.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.3d43f6bf.js";import{_ as A}from"./CrudView.vue_vue_type_script_setup_true_lang.fc3376a4.js";import{B}from"./BaseLayout.40ae7430.js";import{a as N}from"./ant-design.080bc381.js";import"./index.a24e4cfd.js";import"./Form.d88e907e.js";import"./Title.e19c9b7e.js";import"./CollapsePanel.ed22c9ce.js";import"./index.3daa08be.js";import"./index.beaf06d8.js";import"./index.16917afa.js";import"./dayjs.12321a58.js";import"./index.06f9a351.js";import"./index.130e9d58.js";import"./TabPane.49afc3f4.js";import"./index.a2705008.js";import"./index.257ed691.js";import"./index.72e9f57c.js";import"./index.4260e6cf.js";import"./index.f0baefdd.js";import"./index.37b8f4ea.js";import"./index.18aa8459.js";import"./index.d09067f1.js";import"./index.6e066317.js";import"./gateway.98993b50.js";import"./activeRecord.b9964a93.js";import"./pubsub.ab26e051.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]="880b80d5-f189-4fad-9769-d58e266682dc",a._sentryDebugIdIdentifier="sentry-dbid-880b80d5-f189-4fad-9769-d58e266682dc")}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(()=>p.list()),s=({key:t})=>{l.push({name:"organization",params:{organizationId:t}})},g=async t=>{const e=await p.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(()=>[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.cc3241aa.js.map
