feat(web): show ban actor and timestamp in chat info
Some checks are pending
CI / test (push) Has started running
Some checks are pending
CI / test (push) Has started running
This commit is contained in:
@@ -168,7 +168,7 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
|
||||
try {
|
||||
const nextBans = await listChatBans(targetChatId);
|
||||
setBans(nextBans);
|
||||
const ids = [...new Set(nextBans.map((item) => item.user_id))];
|
||||
const ids = [...new Set(nextBans.flatMap((item) => [item.user_id, item.banned_by_user_id]))];
|
||||
const profiles = await Promise.all(ids.map((id) => getUserById(id)));
|
||||
const byId: Record<number, AuthUser> = {};
|
||||
for (const profile of profiles) {
|
||||
@@ -712,6 +712,9 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
|
||||
<div className="min-w-0">
|
||||
<p className="truncate text-xs font-semibold text-slate-200">{user?.name || `user #${ban.user_id}`}</p>
|
||||
<p className="truncate text-[11px] text-slate-400">@{user?.username || "unknown"}</p>
|
||||
<p className="truncate text-[10px] text-slate-500">
|
||||
by @{bannedUsers[ban.banned_by_user_id]?.username || `user${ban.banned_by_user_id}`} • {new Date(ban.created_at).toLocaleString()}
|
||||
</p>
|
||||
<p className="truncate text-[10px] text-slate-500">Right click for actions</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user