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