import { Badge } from '@@/Badge'; import { StatusDot } from '@@/primitives/StatusDot'; import { WorkflowStatus, WorkflowType, DeploymentPlatform, } from '../workflows/types'; const BADGE_TYPE = { healthy: 'success', error: 'danger', syncing: 'warn', paused: 'muted', unknown: 'muted', } as const; const STATUS_LABELS: Record = { healthy: 'Healthy', error: 'Error', syncing: 'Syncing', paused: 'Paused', unknown: 'Unknown', }; export function StatusBadge({ status }: { status: WorkflowStatus }) { return ( {STATUS_LABELS[status]} ); } const TYPE_LABELS: Record = { stack: 'Stack', edgeStack: 'Edge Stack', }; export function TypeBadge({ type }: { type: WorkflowType }) { return {TYPE_LABELS[type]}; } const PLATFORM_LABELS: Record = { dockerStandalone: 'Docker Standalone', dockerSwarm: 'Docker Swarm', kubernetes: 'Kubernetes', }; export function PlatformBadge({ platform, }: { platform: DeploymentPlatform | undefined; }) { return ( {platform ? PLATFORM_LABELS[platform] : 'Unknown'} ); }