PageSourceSearch

https://slatedata.ai/assets/page-CepB3f9q.js

js slatedata.ai collected 2026-10-05 15:05:40 UTC 2,908 bytes, 1 lines download raw bytes

1import{p as g,r as b,j as e,S as l,B as m,b as T,h as v,v as A,T as y,G as d,g as S,V as G,o as I,A as z}from"./index-CB1LRsvg.js";import{I as k}from"./IconAlertCircle-BJepXZla.js";import{I as w}from"./IconArrowLeft-Ds_130vQ.js";import{I as R}from"./IconTrash-B56plgcD.js";import{a as E}from"./useGroups-BxyqH8s2.js";import{u as L}from"./usePageTitle-PP7G01cs.js";import{S as C}from"./StatusText-gwUfW1V-.js";import{u as F}from"./useConfirm-B_NA31aX.js";import{u as P}from"./use-form-CaiTdMy3.js";import{A as $}from"./Alert-Dvpb9ICu.js";import{T as s}from"./Table-D4aHVX52.js";import{A as B}from"./Avatar-BsrwxVRy.js";import"./index-C148XJoK.js";function Y(){const{id:c}=g(),{group:a,loading:o,error:n,addMember:u,removeMember:p}=E(c??null);L(a?`Group: ${a.name}`:"Team Group");const{confirm:x,confirmDialog:h}=F(),i=P({mode:"controlled",initialValues:{email:""}}),[j,t]=b.useState(!1),f=async({email:r})=>{if(!r.trim())return;t(!0),i.clearErrors(),await u(r.trim())?i.reset():i.setFieldError("email","User not found or already in group."),t(!1)};return e.jsxs(l,{gap:"lg",children:[e.jsx(m,{component:T,to:"/settings/groups",variant:"subtle",size:"xs",leftSection:e.jsx(w,{size:14,"aria-hidden":!0}),style:{alignSelf:"flex-start"},children:"Back to Groups"}),o&&!a&&e.jsx(v,{role:"status","aria-label":"Loading group"}),(n||!o&&!a)&&e.jsx($,{color:"red",icon:e.jsx(k,{size:16,"aria-hidden":!0}),children:n??"Group not found."}),a&&e.jsxs(e.Fragment,{children:[e.jsxs(l,{gap:2,children:[e.jsx(A,{order:2,children:a.name}),a.description&&e.jsx(y,{size:"sm",c:"dimmed",children:a.description})]}),e.jsx("form",{onSubmit:i.onSubmit(r=>void f(r)),children:e.jsxs(d,{align:"flex-end",gap:"sm",children:[e.jsx(S,{label:"Add member by email",type:"email",placeholder:"[email protected]",required:!0,...i.getInputProps("email"),flex:1,maw:360}),e.jsx(m,{type:"submit",variant:"default",loading:j,disabled:!i.values.email.trim(),children:"Add"})]})}),a.members.length===0?e.jsx(C,{size:"sm",c:"dimmed",children:"No members yet."}):e.jsx(s.ScrollContainer,{minWidth:420,children:e.jsxs(s,{"aria-label":"Group members",children:[e.jsx(s.Thead,{children:e.jsxs(s.Tr,{children:[e.jsx(s.Th,{children:"Username"}),e.jsx(s.Th,{children:"Email"}),e.jsx(s.Th,{children:e.jsx(G,{children:"Actions"})})]})}),e.jsx(s.Tbody,{children:a.members.map(r=>e.jsxs(s.Tr,{children:[e.jsx(s.Td,{children:e.jsxs(d,{gap:"xs",wrap:"nowrap",children:[e.jsx(B,{name:r.username,size:"sm",radius:"xl"}),e.jsx("span",{children:r.username})]})}),e.jsx(s.Td,{children:r.email??"—"}),e.jsx(s.Td,{children:e.jsx(I,{label:"Remove",children:e.jsx(z,{"aria-label":`Remove ${r.username}`,variant:"subtle",color:"red",onClick:async()=>{await x({title:"Remove member",message:`Remove ${r.username} from ${a.name}?`,confirmLabel:"Remove"})&&p(r.user_id)},children:e.jsx(R,{size:16,"aria-hidden":!0})})})})]},r.user_id))})]})})]}),h]})}export{Y as default};

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.