import{u as P,j as k}from"./query-ATBhtd3K.js";import{r as u}from"./vendor-EnoIVk-c.js";import{d as D,e as E,f as N,g as S,w as j,x as w,b as F,T as Q}from"./en-IUV4ZXKH-BjYNERUx.js";import{T as q}from"./ToolbarPanels-tcvPzqNN.js";import{u as K}from"./i18n-BYxb14hm.js";import"./index-D4SjcYxX.js";import"./useAuth-CqtZE9nt.js";import"./AuthContext-CYne_gJM.js";import"./routing-nZgBtxly.js";import"./KnowledgeBaseContext-CgnF8K-_.js";import"./PlusIcon-qGFPUzg0.js";function V(){const{t:d}=K(),e=(s,a)=>d(`AdminUsers.${s}`,a),o=P(),{activePanel:m}=D(),{theme:c,setTheme:i}=E(),{showLineNumbers:U,toggleLineNumbers:l}=N(),p=u.useCallback(({theme:s})=>{i(s)},[i]),g=u.useCallback(()=>{l()},[l]);S({"settings:theme-changed":p,"settings:line-numbers-toggled":g});const t=j(),{data:n,isLoading:h}=t.users.list.useQuery(),{data:r,isLoading:v}=t.users.stats.useQuery(),C=t.users.update.useMutation(),b=(n==null?void 0:n.users)??[],y=(r==null?void 0:r.stats)??null,A=async(s,a)=>{try{await C.mutateAsync({id:s,data:a}),o.invalidateQueries({queryKey:["admin.users.list"]}),o.invalidateQueries({queryKey:["admin.users.stats"]})}catch(T){console.error("Failed to update user:",T)}},L=async s=>{console.warn("Delete user not implemented:",s),alert("Delete user functionality is not currently available")},x=()=>{console.log("Add user clicked")},f=()=>{console.log("Export users clicked")};return k.jsx(w,{users:b,userStats:y,isLoadingUsers:h,isLoadingStats:v,onUpdateUser:A,onDeleteUser:L,onAddUser:x,onExportUsers:f,theme:c,showLineNumbers:U,activePanel:m,translations:{title:e("title"),subtitle:e("subtitle"),addUser:e("addUser"),totalUsers:e("totalUsers"),activeUsers:e("activeUsers"),administrators:e("administrators"),recentUsers:e("recentUsers"),searchUsers:e("searchUsers"),searchPlaceholder:e("searchPlaceholder"),role:e("role"),allRoles:e("allRoles"),admin:e("admin"),user:e("user"),status:e("status"),allStatus:e("allStatus"),active:e("active"),inactive:e("inactive"),exportUsers:e("exportUsers"),loadingUsers:e("loadingUsers"),userColumn:e("userColumn"),domainColumn:e("domainColumn"),roleColumn:e("roleColumn"),statusColumn:e("statusColumn"),lastLoginColumn:e("lastLoginColumn"),joinedColumn:e("joinedColumn"),actionsColumn:e("actionsColumn"),noUsersFound:e("noUsersFound"),noUsersFoundDescription:e("noUsersFoundDescription"),noName:e("noName"),never:e("never"),removeAdmin:e("removeAdmin"),makeAdmin:e("makeAdmin"),deactivateUser:e("deactivateUser"),activateUser:e("activateUser"),deleteUser:e("deleteUser")},ToolbarPanels:q,Toolbar:Q,buttonStyles:F})}export{V as default};
//# sourceMappingURL=client-87q-RlKa.js.map
