export function formatTime(iso) {
  if (!iso) return ''
  return new Date(iso).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
}

const CODE_COLORS = {
  HEART_RATE: '#ef4444',
  RESP_RATE: '#3b82f6',
  SYSTOLIC_BP: '#8b5cf6',
  SPO2: '#06b6d4',
  TEMP_C: '#f59e0b',
}

export function getColorForCode(code) {
  return CODE_COLORS[code] ?? '#6b7280'
}
