const onlineStatusLabels: Record<string, string> = {
  ONLINE: '在线',
  OFFLINE: '离线',
};

const lampStatusLabels: Record<string, string> = {
  NORMAL: '正常',
  FAULT: '故障',
  MAINTENANCE: '维护中',
  OFFLINE: '离线',
};

const alarmStatusLabels: Record<string, string> = {
  OPEN: '待处理',
  PROCESSING: '处理中',
  RESOLVED: '已恢复',
  IGNORED: '已忽略',
};

const alarmLevelLabels: Record<string, string> = {
  LOW: '低',
  MEDIUM: '中',
  HIGH: '高',
  CRITICAL: '严重',
};

const userStatusLabels: Record<string, string> = {
  ACTIVE: '启用',
  DISABLED: '停用',
};

export function onlineStatusText(value?: string) {
  return value ? onlineStatusLabels[value] ?? value : '-';
}

export function lampStatusText(value?: string) {
  return value ? lampStatusLabels[value] ?? value : '-';
}

export function alarmStatusText(value?: string) {
  return value ? alarmStatusLabels[value] ?? value : '-';
}

export function alarmLevelText(value?: string) {
  return value ? alarmLevelLabels[value] ?? value : '-';
}

export function userStatusText(value?: string) {
  return value ? userStatusLabels[value] ?? value : '-';
}
