feat(dashboard): expose trust reputation + reactions leaderboard
- GET /api/dashboard/reactions: top reacted messages (net add-remove), joined with message content, channel name, top 3 emoji breakdown - Users tab: colored trust tier badge (Trusted/Netral/At Risk/Kritis) in list rows + detail panel (was plain number badge) - Dashboard: new Reactions sub-tab with leaderboard (rank, emoji cluster, message, author, channel, count)
This commit is contained in:
@@ -4,6 +4,7 @@ export {
|
||||
useChannelDetail,
|
||||
useChannels,
|
||||
useStats,
|
||||
useTopReactions,
|
||||
useUserDetail,
|
||||
useUsers,
|
||||
} from "./use-dashboard";
|
||||
|
||||
@@ -6,6 +6,7 @@ import type {
|
||||
DashboardChannelDetail,
|
||||
DashboardStats,
|
||||
DashboardUserDetail,
|
||||
TopReactedMessage,
|
||||
} from "@/lib/types";
|
||||
|
||||
export function useStats() {
|
||||
@@ -63,3 +64,9 @@ export function useChannelDetail(channelId: string | null) {
|
||||
() => dashboardApi.getChannelDetail(channelId!),
|
||||
);
|
||||
}
|
||||
|
||||
export function useTopReactions(limit = 20) {
|
||||
return useSWR<TopReactedMessage[]>(["dashboard-reactions", limit], () =>
|
||||
dashboardApi.getTopReactions(limit),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user