import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.34ebc37e.js";import{a as I}from"./asyncComputed.35a4b27a.js";import{b as k}from"./router.719f3d63.js";import"./index.081cf5ad.js";import{M as n}from"./member.ead4eef7.js";import{C as x}from"./CrudView.8134f016.js";import{L as C}from"./icons.8f30991f.js";import{a as v}from"./ant-design.faa1a77d.js";import"./Form.38063bb5.js";import"./hasIn.58ff2131.js";import"./popupNotifcation.9ce529ca.js";import"./index.cf4c23b9.js";import"./record.cbdf5e50.js";import"./pubsub.35a24abb.js";import"./Paragraph.2cb0b8ab.js";import"./Base.1bb23522.js";import"./Typography.316976a3.js";import"./Modal.70683480.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.52f83311.js";import"./url.c45872e6.js";import"./index.5fefec1c.js";import"./Title.0157a531.js";import"./Text.979656fd.js";import"./index.e0c340f2.js";import"./index.5a0da0cf.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]="b87c9c9a-d608-468f-9aa8-7155914ea7e0",t._sentryDebugIdIdentifier="sentry-dbid-b87c9c9a-d608-468f-9aa8-7155914ea7e0")}catch{}})();const Y=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 p(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:d,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:()=>p(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"entity-name":"members",loading:h(d),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{Y as default};
//# sourceMappingURL=Editors.58828055.js.map
