feat(fe): add Member Intelligence (/users) page wired to full reputation data
- New /users route: member roster (trust score, clean/flagged counts, message volume) + inspector detail (trust breakdown, clean streak, infractions, AI profile, recent messages) with live search - Backend dashboard.listUsers/getUserDetail now JOIN user_reputations to expose trust_score, clean_message_streak, total_infractions, last_infraction_at + warn_count/clean_count breakdowns - Frontend types updated to match; useUsers refactored to PaginatedUsers shape, added useUserSearch for the old search behavior - Nav rail + mobile nav: add Users entry
This commit is contained in:
@@ -7,6 +7,7 @@ export {
|
||||
useTopReactions,
|
||||
useTopReactors,
|
||||
useUserDetail,
|
||||
useUserSearch,
|
||||
useUsers,
|
||||
} from "./use-dashboard";
|
||||
export { useGuilds } from "./use-guilds";
|
||||
|
||||
@@ -6,6 +6,7 @@ import type {
|
||||
DashboardChannelDetail,
|
||||
DashboardStats,
|
||||
DashboardUserDetail,
|
||||
PaginatedUsers,
|
||||
TopReactedMessage,
|
||||
TopReactor,
|
||||
} from "@/lib/types";
|
||||
@@ -33,7 +34,15 @@ export function useActivity(days = 14, initialData?: DashboardActivity) {
|
||||
);
|
||||
}
|
||||
|
||||
export function useUsers(search?: string) {
|
||||
export function useUsers(initialData?: PaginatedUsers) {
|
||||
return useSWR<PaginatedUsers>(
|
||||
["dashboard-users"],
|
||||
() => dashboardApi.listUsers(50),
|
||||
{ fallbackData: initialData },
|
||||
);
|
||||
}
|
||||
|
||||
export function useUserSearch(search?: string) {
|
||||
return useSWR(
|
||||
["dashboard-users", search ?? ""],
|
||||
async () => {
|
||||
|
||||
Reference in New Issue
Block a user