PageSourceSearch

https://cloud.resilis.io/assets/invite-member-CTmu5SvD.js

js resilis.io collected 2026-09-24 19:38:48 UTC 2,209 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-vendor-DSsww-Kv.js";import{a as o}from"./react-vendor-NvA41F0Y.js";import{a1 as b,f as j,an as g,B as S,w as y}from"./index-DAt3PBr5.js";import{I}from"./input-BJ_IkYk8.js";import{L as p}from"./label-C1gC47fQ.js";import{S as N,a as C,b as E,c as w,d as x}from"./select-A6ob4bc1.js";import"./chevron-down-CcJPVXaR.js";function B(){const[c,l]=o.useState(""),[r,m]=o.useState("member"),[i,d]=o.useState(!1),{toast:n}=b(),h=j(),a=g(),v=async t=>{t.preventDefault();let s;try{s=a.capture(h)}catch{return}a.commit(s,()=>d(!0));try{const{error:u}=await a.run(s,({scope:f})=>y.organization.inviteMember({email:c,role:r,organizationId:f.organizationId}));if(u){a.commit(s,()=>{n({title:"Error",description:u.message||"Failed to send invitation",variant:"destructive"})});return}a.commit(s,()=>{n({title:"Success",description:"Invitation sent successfully"}),l(""),m("member")})}catch{a.commit(s,()=>{n({title:"Error",description:"An unexpected error occurred",variant:"destructive"})})}finally{d(!1)}};return e.jsx("div",{className:"container mx-auto py-8",children:e.jsxs("div",{className:"max-w-2xl",children:[e.jsx("h1",{className:"text-2xl font-display font-bold tracking-wider text-foreground mb-6",children:"Invite Member"}),e.jsxs("form",{onSubmit:v,className:"space-y-6 border bg-card p-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"email",children:"Email Address"}),e.jsx(I,{id:"email",type:"email",placeholder:"[email protected]",value:c,onChange:t=>l(t.target.value),required:!0,disabled:i})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"role",children:"Role"}),e.jsxs(N,{value:r,onValueChange:t=>{(t==="member"||t==="admin")&&m(t)},children:[e.jsx(C,{children:e.jsx(E,{})}),e.jsxs(w,{children:[e.jsx(x,{value:"member",children:"Member"}),e.jsx(x,{value:"admin",children:"Admin"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r==="member"?"Can view resources and perform limited actions":"Can manage all resources and invite members"})]})]}),e.jsx(S,{type:"submit",disabled:i,children:i?"Sending...":"Send Invitation"})]})]})})}export{B as InviteMemberPage};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.