InvestigationBadge.tsx
1 // Copyright (c) 2026 VPL Solutions. All rights reserved. 2 // Licensed under the MIT License. See LICENSE for details. 3 4 import type { InvestigationStatus } from '../../api/investigation'; 5 import { STATUS_META } from '../../data/investigationStates'; 6 7 interface InvestigationBadgeProps { 8 status: InvestigationStatus; 9 pulse?: boolean; 10 } 11 12 export function InvestigationBadge({ status, pulse }: InvestigationBadgeProps) { 13 const meta = STATUS_META[status]; 14 const shouldPulse = pulse ?? status === 'AWAITING_APPROVAL'; 15 16 return ( 17 <span className={`inline-flex items-center gap-1.5 text-xs font-medium px-2.5 py-1 rounded-full ${meta.bgColor} ${meta.color}`}> 18 <span className={`w-1.5 h-1.5 rounded-full ${meta.dotColor} ${shouldPulse ? 'animate-pulse' : ''}`} /> 19 {meta.label} 20 </span> 21 ); 22 }