fix: show email for OAuth/email users in traffic table

Add email field to UserTrafficItem type and display it below
user name when no Telegram username is present.
This commit is contained in:
Fringg
2026-02-08 22:04:57 +03:00
parent 893c69ab6f
commit a8ea5c958f
2 changed files with 7 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ export interface UserTrafficItem {
user_id: number;
telegram_id: number | null;
username: string | null;
email: string | null;
full_name: string;
tariff_name: string | null;
subscription_status: string | null;

View File

@@ -1381,11 +1381,15 @@ export default function AdminTrafficUsage() {
</div>
<div className="min-w-0">
<div className="truncate text-xs font-medium text-dark-100">{item.full_name}</div>
{item.username && (
{item.username ? (
<div className="truncate text-[10px] leading-tight text-dark-500">
@{item.username}
</div>
)}
) : item.email ? (
<div className="truncate text-[10px] leading-tight text-dark-500">
{item.email}
</div>
) : null}
</div>
</div>
);