export type StatusTone = 'emerald' | 'cyan' | 'rose' | 'amber' | 'violet' | 'orange' | 'glass'

export function statusToneFromSeverity(severity: string): StatusTone {
  switch (severity.toLowerCase()) {
    case 'critical':
      return 'rose'
    case 'high':
      return 'orange'
    case 'medium':
      return 'amber'
    case 'low':
      return 'cyan'
    case 'info':
      return 'glass'
    default:
      return 'glass'
  }
}

export function statusToneFromState(state: string): StatusTone {
  switch (state.toLowerCase()) {
    case 'active':
    case 'connected':
    case 'passing':
    case 'enabled':
    case 'healthy':
      return 'emerald'
    case 'running':
    case 'testing':
    case 'completed':
      return 'cyan'
    case 'error':
    case 'failed':
    case 'disconnected':
    case 'attention':
      return 'rose'
    case 'pending':
    case 'needs_setup':
    case 'needs_review':
    case 'stale':
    case 'available':
    case 'queued':
    case 'generating':
    case 'purging':
      return 'amber'
    case 'quarantined':
      return 'violet'
    case 'disabled':
    case 'inactive':
    case 'decommissioned':
    default:
      return 'glass'
  }
}
