import{d as b,ez as y,F as g,b as _,c as w,u as h}from"./outputWidgets.149ec695.js";import{a as I}from"./asyncComputed.89365f8b.js";import{b as k}from"./router.35f50650.js";import"./index.737a9c1b.js";import{M as n}from"./member.3954c3bb.js";import{C as x}from"./CrudView.3b708329.js";import{F as C}from"./icons.ce69a27b.js";import{a as M}from"./ant-design.4d2ef4d2.js";import"./FormItem.338256bd.js";import"./hasIn.708aa645.js";import"./jwt-decode.esm.74bd4619.js";import"./storage.d8354481.js";import"./index.fc8ecc48.js";import"./index.cf4c23b9.js";import"./record.5c1f9715.js";import"./pubsub.f0cce5f6.js";import"./Title.d69f1878.js";import"./Text.726003d1.js";import"./Form.15d279f3.js";import"./Modal.cf793feb.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.238d1a0c.js";import"./url.9af78d6c.js";import"./index.2ed092ca.js";import"./index.1570e79d.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]="5a52481c-3ced-4d10-9b84-a267c970255a",t._sentryDebugIdIdentifier="sentry-dbid-5a52481c-3ced-4d10-9b84-a267c970255a")}catch{}})();const X=b({__name:"Members",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 M("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=Members.fb82d222.js.map
