feat(web): show ban actor and timestamp in chat info
Some checks are pending
CI / test (push) Has started running

This commit is contained in:
2026-03-08 21:42:13 +03:00
parent 4b95f84f6e
commit c742d785e3
2 changed files with 5 additions and 2 deletions

View File

@@ -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>