Browse Source

feat(clients): show last-online tooltip on the depleted tag too

The Online column already surfaced last-online on the offline tag; extend the same tooltip to the depleted (ended) tag so a depleted client's last activity is visible without enabling it.
MHSanaei 10 hours ago
parent
commit
cfd3b34362
1 changed files with 8 additions and 3 deletions
  1. 8 3
      frontend/src/pages/clients/ClientsPage.tsx

+ 8 - 3
frontend/src/pages/clients/ClientsPage.tsx

@@ -627,15 +627,20 @@ export default function ClientsPage() {
       width: 90,
       render: (_v, record) => {
         const bucket = clientBucket(record);
-        if (bucket === 'depleted') return <Tag color="red">{t('depleted')}</Tag>;
+        const lastOnline = record.traffic?.lastOnline ?? 0;
+        const lastOnlineTitle = `${t('lastOnline')}: ${lastOnline > 0 ? IntlUtil.formatDate(lastOnline, datepicker) : '-'}`;
+        if (bucket === 'depleted') return (
+          <Tooltip title={lastOnlineTitle}>
+            <Tag color="red">{t('depleted')}</Tag>
+          </Tooltip>
+        );
         if (record.enable && isOnline(record.email)) return (
           <Tag color="green"><span className="online-dot" />{t('pages.clients.online')}</Tag>
         );
         if (!record.enable) return <Tag>{t('disabled')}</Tag>;
         if (bucket === 'expiring') return <Tag color="orange">{t('depletingSoon')}</Tag>;
-        const lastOnline = record.traffic?.lastOnline ?? 0;
         return (
-          <Tooltip title={`${t('lastOnline')}: ${lastOnline > 0 ? IntlUtil.formatDate(lastOnline, datepicker) : '-'}`}>
+          <Tooltip title={lastOnlineTitle}>
             <Tag>{t('pages.clients.offline')}</Tag>
           </Tooltip>
         );