PageSourceSearch

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

js slatedata.ai collected 2026-10-05 15:05:25 UTC 3,731 bytes, 1 lines download raw bytes

1import{f as I,r as l,j as e,S as c,G as x,v as k,T as j,B as d,c as w,h as A,V as D,z,b as E,o as B,A as L,w as P,g as $,R as N}from"./index-CB1LRsvg.js";import{I as O}from"./IconAlertCircle-BJepXZla.js";import{I as V}from"./IconUsers-D7UWYmlL.js";import{I as F}from"./IconTrash-B56plgcD.js";import{u as M}from"./useGroups-BxyqH8s2.js";import{u as q}from"./usePageTitle-PP7G01cs.js";import{u as H}from"./useConfirm-B_NA31aX.js";import{E as R}from"./EmptyState-DqWHbZL6.js";import{u as U}from"./use-form-CaiTdMy3.js";import{A as g}from"./Alert-Dvpb9ICu.js";import{T as s}from"./Table-D4aHVX52.js";import{B as W}from"./Badge-CvorhVBt.js";import"./ThemeIcon-DUJfKgY0.js";import"./index-C148XJoK.js";function ne(){q("Team Groups");const{groups:i,loading:f,error:n,createGroup:b,deleteGroup:T}=M(),u=I(),{confirm:C,confirmDialog:y}=H(),[v,t]=l.useState(!1),o=U({mode:"controlled",initialValues:{name:"",description:""},validate:{name:r=>r.trim()?null:"Group name is required."}}),[S,p]=l.useState(!1),[m,h]=l.useState(null),G=async r=>{h(null),p(!0);const a=await b(r.name.trim(),r.description.trim());if(p(!1),!a){h(n??"Failed to create group.");return}t(!1),o.reset(),u(`/settings/groups/${a.id}`)};return e.jsxs(c,{gap:"lg",children:[e.jsxs(x,{justify:"space-between",align:"flex-end",children:[e.jsxs(c,{gap:2,children:[e.jsx(k,{order:2,children:"Groups"}),e.jsx(j,{size:"sm",c:"dimmed",children:"Bundle users together and grant a workspace role to the whole group in one shot."})]}),e.jsx(d,{variant:"primary",leftSection:e.jsx(w,{size:16,"aria-hidden":!0}),onClick:()=>t(!0),children:"Create group"})]}),n&&e.jsx(g,{color:"red",icon:e.jsx(O,{size:16,"aria-hidden":!0}),children:n}),f&&!i&&e.jsx(A,{role:"status","aria-label":"Loading groups"}),i&&i.length===0?e.jsx("div",{role:"status",children:e.jsx(R,{icon:e.jsx(V,{size:20,"aria-hidden":!0}),title:"No groups in this team yet",description:"Create a group to grant a workspace role to many people at once."})}):e.jsx(s.ScrollContainer,{minWidth:480,children:e.jsxs(s,{highlightOnHover:!0,"aria-label":"Groups",children:[e.jsx(s.Thead,{children:e.jsxs(s.Tr,{children:[e.jsx(s.Th,{children:"Name"}),e.jsx(s.Th,{children:"Description"}),e.jsx(s.Th,{children:"Members"}),e.jsx(s.Th,{children:e.jsx(D,{children:"Actions"})})]})}),e.jsx(s.Tbody,{children:(i??[]).map(r=>e.jsxs(s.Tr,{style:{cursor:"pointer"},onClick:()=>u(`/settings/groups/${r.id}`),children:[e.jsx(s.Td,{children:e.jsx(z,{component:E,to:`/settings/groups/${r.id}`,fw:500,c:"inherit",underline:"never",children:r.name})}),e.jsx(s.Td,{children:e.jsx(j,{size:"sm",c:"dimmed",lineClamp:1,children:r.description??""})}),e.jsx(s.Td,{children:e.jsx(W,{variant:"light",children:r.member_count})}),e.jsx(s.Td,{onClick:a=>a.stopPropagation(),children:e.jsx(B,{label:"Delete group",children:e.jsx(L,{"aria-label":`Delete group ${r.name}`,variant:"subtle",color:"red",onClick:async()=>{await C({title:"Delete group",message:`Delete group "${r.name}"? Members keep their individual access.`,confirmLabel:"Delete"})&&T(r.id)},children:e.jsx(F,{size:16,"aria-hidden":!0})})})})]},r.id))})]})}),y,e.jsx(P,{opened:v,onClose:()=>t(!1),title:"Create a group",children:e.jsx("form",{onSubmit:o.onSubmit(r=>void G(r)),noValidate:!0,children:e.jsxs(c,{gap:"md",children:[e.jsx($,{label:"Name",placeholder:"Engineering",required:!0,"data-autofocus":!0,...o.getInputProps("name")}),e.jsx(N,{label:"Description",placeholder:"Optional",rows:2,...o.getInputProps("description")}),m&&e.jsx(g,{color:"red",children:m}),e.jsxs(x,{justify:"flex-end",children:[e.jsx(d,{type:"button",variant:"default",onClick:()=>t(!1),children:"Cancel"}),e.jsx(d,{type:"submit",variant:"primary",loading:S,children:"Create"})]})]})})})]})}export{ne 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.