import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.cd9a7023.js";import{a as I}from"./asyncComputed.d485b66f.js";import{b as k}from"./router.3892c6ef.js";import"./index.9161dd13.js";import{M as n}from"./member.617a547c.js";import{C as x}from"./CrudView.ac7cecc9.js";import{K as C}from"./icons.0bc7085f.js";import{a as v}from"./ant-design.b8fb837f.js";import"./Form.6eabd32b.js";import"./hasIn.5fdc0bbb.js";import"./popupNotifcation.d4f20194.js";import"./index.cf4c23b9.js";import"./record.4940789d.js";import"./pubsub.56df9c23.js";import"./Paragraph.7a1e228a.js";import"./Base.db9f67df.js";import"./Typography.686aa668.js";import"./Modal.45b0cd08.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.83861dc8.js";import"./url.60859896.js";import"./index.ad4a79ec.js";import"./Title.05e583cd.js";import"./Text.8af9010b.js";import"./index.d8200973.js";import"./index.1cb62237.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]="c3d52339-2c0a-4ca8-a270-bf91d5d4596e",t._sentryDebugIdIdentifier="sentry-dbid-c3d52339-2c0a-4ca8-a270-bf91d5d4596e")}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 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{Y as default};
//# sourceMappingURL=Editors.efd1891c.js.map
