feat: add user profile link button in ticket detail

Add a button next to the ticket sender info that navigates to the
user's admin detail page. Localized in all 4 languages.
This commit is contained in:
Fringg
2026-02-07 05:39:30 +03:00
parent 5664b283d6
commit d483d84f1c
5 changed files with 24 additions and 10 deletions

View File

@@ -1278,6 +1278,7 @@
"reminderCooldownDesc": "Minimum time between reminders (1-120 minutes)",
"settingsUpdateError": "Error saving settings",
"copyTelegramId": "Click to copy Telegram ID",
"viewUser": "Profile",
"cabinetNotifications": "Cabinet Notifications",
"userNotificationsEnabled": "User Notifications",
"userNotificationsEnabledDesc": "Send notifications to users about admin replies",

View File

@@ -990,6 +990,7 @@
"adminNotificationsEnabledDesc": "ارسال اعلان به مدیران درباره تیکت‌ها و پاسخ‌های جدید",
"cabinetNotifications": "اعلان‌های پنل",
"copyTelegramId": "برای کپی شناسه تلگرام کلیک کنید",
"viewUser": "کاربر",
"userNotificationsEnabled": "اعلان‌های کاربر",
"userNotificationsEnabledDesc": "ارسال اعلان به کاربران درباره پاسخ‌های مدیر"
},

View File

@@ -1793,6 +1793,7 @@
"reminderCooldownDesc": "Минимальное время между напоминаниями (1-120 минут)",
"settingsUpdateError": "Ошибка сохранения настроек",
"copyTelegramId": "Нажмите чтобы скопировать Telegram ID",
"viewUser": "Карточка",
"cabinetNotifications": "Уведомления в кабинете",
"userNotificationsEnabled": "Уведомления для пользователей",
"userNotificationsEnabledDesc": "Отправлять уведомления пользователям об ответах админа",

View File

@@ -1028,6 +1028,7 @@
"adminNotificationsEnabledDesc": "向管理员发送新工单和回复通知",
"cabinetNotifications": "面板通知",
"copyTelegramId": "点击复制Telegram ID",
"viewUser": "用户",
"userNotificationsEnabled": "用户通知",
"userNotificationsEnabledDesc": "向用户发送管理员回复通知"
},

View File

@@ -434,19 +434,29 @@ export default function AdminTickets() {
</span>
</div>
</div>
<div className="mb-4 text-sm text-dark-500">
{t('admin.tickets.from')}: {formatUser(selectedTicket)}
{selectedTicket.user?.telegram_id && (
<div className="mb-4 flex items-center gap-2 text-sm text-dark-500">
<span>
{t('admin.tickets.from')}: {formatUser(selectedTicket)}
{selectedTicket.user?.telegram_id && (
<button
onClick={() => copyToClipboard(String(selectedTicket.user!.telegram_id))}
className="ml-1 rounded bg-dark-700 px-2 py-0.5 text-xs transition-colors hover:bg-dark-600"
title={t('admin.tickets.copyTelegramId')}
>
TG: {selectedTicket.user!.telegram_id}
</button>
)}{' '}
| {t('admin.tickets.created')}:{' '}
{new Date(selectedTicket.created_at).toLocaleString()}
</span>
{selectedTicket.user && (
<button
onClick={() => copyToClipboard(String(selectedTicket.user!.telegram_id))}
className="ml-1 rounded bg-dark-700 px-2 py-0.5 text-xs transition-colors hover:bg-dark-600"
title={t('admin.tickets.copyTelegramId')}
onClick={() => navigate(`/admin/users/${selectedTicket.user!.id}`)}
className="shrink-0 rounded-lg border border-accent-500/30 bg-accent-500/10 px-2 py-0.5 text-xs text-accent-400 transition-colors hover:bg-accent-500/20"
>
TG: {selectedTicket.user!.telegram_id}
{t('admin.tickets.viewUser')}
</button>
)}{' '}
| {t('admin.tickets.created')}:{' '}
{new Date(selectedTicket.created_at).toLocaleString()}
)}
</div>
<div className="flex flex-wrap gap-2">
{['open', 'pending', 'answered', 'closed'].map((s) => (