StatusBadge: fix normal badge — only check status_code, not text

The previous condition 'c === "normal" && !t' required status_text to be
empty, but enriched records carry text suffixes like '正常 + CL4h' which
are truthy and dropped normal records into the '異常' fallback.

3 Kaka records (id=22/28/30) were affected — act_in 10:38/10:43 (early),
act_out 20:00 (on time), so they should render the green '正常' badge but
were showing '異常' instead.
This commit is contained in:
IT狗
2026-07-21 22:13:12 +08:00
parent 7702fe4ae5
commit 4bd6d0e7c8
+3 -2
View File
@@ -48,8 +48,9 @@ export default function StatusBadge({ code = '', text = '', size = 'sm' }) {
return badge(<Briefcase size={12} />, '請假', 'bg-violet-100 text-violet-700')
}
// 正常
if (c === 'normal' && !t) {
// 正常 (only when status_code is 'normal' — text suffix like '+ CL4h' is allowed,
// we still want to flag it as 正常 first since the employee did clock in/out normally)
if (c === 'normal') {
return badge(<CheckCircle size={12} />, '正常', 'bg-green-100 text-green-700')
}