diff --git a/frontend/src/components/StatusBadge.jsx b/frontend/src/components/StatusBadge.jsx index f0edc04..8d3a8b4 100644 --- a/frontend/src/components/StatusBadge.jsx +++ b/frontend/src/components/StatusBadge.jsx @@ -32,9 +32,10 @@ export default function StatusBadge({ code = '', text = '', size = 'sm' }) { ) - // Extract leave/holiday suffix from status_text: + // Extract leave suffix from status_text (holiday suffix dropped — the main + // badge already says 公假, so repeating the long name like + // '香港特別行政區成立紀念日' clutters the row). // '異常-遲到48分 + SL2h' → ['SL2h'] - // '缺勤 (🎉香港特別行政區成立紀念日)' → ['🎉香港特別行政區成立紀念日'] // 'OT3分 + AL4h + SL3h' → ['AL4h', 'SL3h'] // '正常 + CL4h' → ['CL4h'] const t = String(text || '') @@ -44,25 +45,17 @@ export default function StatusBadge({ code = '', text = '', size = 'sm' }) { for (let i = 1; i < split.length; i++) { noteParts.push(split[i].replace(/^\(|\)$/g, '').trim()) } - } else if (t.includes('🎉')) { - const m = t.match(/🎉[^)\s]+(?:\s[^)\s]+)*/) - if (m) noteParts.push(m[0]) } const noteChips = noteParts.filter(Boolean).map((part, idx) => { - // Strip trailing ')' - const clean = part.replace(/\)+$/, '') - const isHoliday = clean.startsWith('🎉') - const cls = isHoliday - ? 'bg-indigo-50 text-indigo-600 border border-indigo-200' - : 'bg-violet-50 text-violet-600 border border-violet-200' + const cls = 'bg-violet-50 text-violet-600 border border-violet-200' return ( - {isHoliday ? clean : `+${clean}`} + +{part} ) })