Copilot commented on code in PR #770:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/770#discussion_r3701414224


##########
web/src/pages/studio/Proxy.tsx:
##########
@@ -183,15 +183,28 @@ const ProxyPage: React.FC = () => {
         icon: <Warning size={12} weight="fill" />,
         label: t('proxy.warning'),
       },
+      unknown: {
+        color: 'default',
+        icon: null,
+        label: t('common.na'),
+      },
     };
-    const cfg = map[status] || map.healthy;
+    const cfg = map[status] || map.unknown;
     return (
       <Tag color={cfg.color} icon={cfg.icon}>
         {cfg.label}
       </Tag>
     );
   };
 
+  const renderUnavailable = () => <Text 
type="secondary">{t('common.na')}</Text>;
+
+  const renderNumberMetric = (value: number | null) =>
+    value == null ? renderUnavailable() : value.toLocaleString();
+
+  const compareNullable = (left: number | null, right: number | null) =>
+    (left ?? Number.NEGATIVE_INFINITY) - (right ?? Number.NEGATIVE_INFINITY);

Review Comment:
   `compareNullable` returns `NaN` when both values are `null` because 
`Number.NEGATIVE_INFINITY - Number.NEGATIVE_INFINITY` is `NaN`. Antd Table 
sorters expect a stable numeric comparator (negative/0/positive); `NaN` can 
lead to unpredictable sort behavior.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to