import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.174c2ebc.js";import{a as I}from"./asyncComputed.b96609d6.js";import{b as k}from"./router.fc48f7ab.js";import"./index.979e5531.js";import{M as n}from"./member.92cdbb34.js";import{C as x}from"./CrudView.f2590a33.js";import{L as C}from"./icons.0b449822.js";import{a as v}from"./ant-design.50c905bb.js";import"./Form.664d60a0.js";import"./hasIn.d60397ef.js";import"./index.cf4c23b9.js";import"./record.3e2ab436.js";import"./pubsub.c25c1191.js";import"./Paragraph.0779ea1c.js";import"./Base.01a39e39.js";import"./Typography.fca84e57.js";import"./Modal.85d9af85.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.1ae089f8.js";import"./url.a9413b47.js";import"./index.8d590eaa.js";import"./Title.02a07c25.js";import"./Text.bb6ae54c.js";import"./index.70c0f8e0.js";import"./index.80e40b83.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="03591102-503a-41aa-a016-d99380b1ec98",t._sentryDebugIdIdentifier="sentry-dbid-03591102-503a-41aa-a016-d99380b1ec98")}catch{}})();const X=b({__name:"Editors",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(a,e.email),m()};async function d(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:p,result:u,refetch:m}=I(()=>n.list(a)),f=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(r=(e=u.value)==null?void 0:e.map(o=>{var s;return{key:o.email,cells:[{type:"text",text:o.email},{type:"text",text:o.role},{type:"actions",actions:((s=k.getAuthor())==null?void 0:s.claims.email)===o.email?[]:[{icon:C,label:"Remove access",onClick:()=>d(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"entity-name":"members",loading:h(p),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:f.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Editors.129d7b82.js.map
