import{d as _,ez as w,G as h,b as k,c as C,w as m,f as d,u as O}from"./outputWidgets.723dbd35.js";import{e as x,d as I}from"./icons.d199659e.js";import{a as v}from"./asyncComputed.6087fd05.js";import"./router.c09623bf.js";import"./index.f80aedcf.js";import{O as l}from"./organization.97807207.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.49d86591.js";import{C as A}from"./CrudView.ca2cf6ee.js";import{B}from"./BaseLayout.d2f45695.js";import{a as N}from"./ant-design.64772334.js";import"./Form.71a7af16.js";import"./index.b41dfd0a.js";import"./record.c3c42720.js";import"./pubsub.97441533.js";import"./gateway.ed2ccaa3.js";import"./logo.084e5d7c.js";import"./index.1d13fc65.js";import"./Title.ad9727d9.js";import"./index.d0473694.js";import"./url.c8598ea1.js";import"./index.4913d787.js";import"./index.f91ebf4c.js";import"./index.c827a0f6.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="91c29779-ca5f-4420-9bcb-68dceb38f918",o._sentryDebugIdIdentifier="sentry-dbid-91c29779-ca5f-4420-9bcb-68dceb38f918")}catch{}})();const et=_({__name:"Organizations",setup(o){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 a=await l.create(t.name);s({key:a.id})},b=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()),f())},y=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(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:b,dangerous:!0}]}]})))!=null?a:[]}});return(t,a)=>(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:g},null,8,["loading","table"])]),_:1}))}});export{et as default};
//# sourceMappingURL=Organizations.7b1c5e97.js.map
