const STATUS_TEXT_MAP: Record<string, string> = {
  ENABLED: "启用",
  DISABLED: "停用",
  DELETED: "已删除",
  PENDING: "待处理",
  CLAIMED: "已认领",
  IN_REVIEW: "审核中",
  APPROVED: "已通过",
  REJECTED: "已拒绝",
  RETURNED: "已退回",
  TRANSFERRED: "已转交",
  NOT_STARTED: "未开始",
  IN_PROGRESS: "进行中",
  COMPLETED: "已完成",
  CANCELED: "已取消",
  CANCELLED: "已取消",
  DELAYED: "已延期",
  FROZEN: "已冻结",
  WAITING: "待开始",
  WAIT_SUBMIT: "待提交",
  WAIT_FINANCE_CONFIRM: "待财务确认",
  CONFIRMED: "已确认",
  PARTIAL_PAID: "部分支付",
  SETTLED: "已结算",
  PROCESSING: "处理中",
  SUCCESS: "成功",
  FAILED: "失败",
  LOCKED: "已锁定",
  UNLOCKED: "已解锁",
  SAVE: "保存",
  SUBMIT: "提交",
  CREATE: "创建",
  UPDATE: "更新",
  DELETE: "删除",
  EXPIRED: "已过期",
  DRAFT: "草稿",
  PUBLISHED: "已发布",
  ARCHIVED: "已归档",
  ROLE: "角色",
  USER: "用户",
  ALL: "全部",
  IDS: "指定ID",
  OWNER: "负责人",
  PROJECT: "项目级",
  MEETING: "会议级",
  APPEND: "追加",
  REPLACE: "替换",
  EXECUTOR: "执行人",
  FINANCE: "财务",
  IN_APP: "站内",
  SMS: "短信",
  EMAIL: "邮件",
  AGENDA: "议程模板",
  SIGN_IN: "签到模板",
  INVITATION: "邀请函模板",
  OTHER: "其他",
  SUBMITTER: "提交人",
  AUDITOR: "审核人",
  FINANCE_ROLE: "财务角色",
  TARGET_USER: "目标用户",
  AUDIT_APPROVED: "审核通过",
  AUDIT_REJECTED: "审核拒绝",
  FINANCE_CONFIRMED: "财务已确认",
  USER_CREATED: "用户创建",
  DELIVERED: "已送达",
  UNREAD: "未读",
  READ: "已读",
};

const AUDIT_NODE_MAP: Record<string, string> = {
  INIT_REVIEW: "初审",
  RE_REVIEW: "复审",
  FINAL_REVIEW: "终审",
};

const ASSIGNEE_TYPE_MAP: Record<string, string> = {
  ROLE: "按角色",
  USER: "按用户",
};

const BIZ_SCENE_MAP: Record<string, string> = {
  MEETING_RECOMMEND: "会议推荐",
  AUDIT_NOTIFY: "审核通知",
  SETTLEMENT: "结算",
};

const MODULE_CODE_MAP: Record<string, string> = {
  BASIC_INFO: "基础资料",
  WRITE_OFF_DOCS: "核销证明",
  EXPERT_LIST: "参会专家",
  MEETING_INVOICE: "发票与流水",
  EXPERT_PROFILE: "专家主档案校验",
};

const formatText = (mapping: Record<string, string>, value?: unknown): string => {
  const key = String(value ?? "").trim();
  if (!key) {
    return "-";
  }
  return mapping[key] || key;
};

export const toZhStatus = (value?: unknown): string => formatText(STATUS_TEXT_MAP, value);

export const toZhAuditNode = (value?: unknown): string => formatText(AUDIT_NODE_MAP, value);

export const toZhAssigneeType = (value?: unknown): string => formatText(ASSIGNEE_TYPE_MAP, value);

export const toZhBizScene = (value?: unknown): string => formatText(BIZ_SCENE_MAP, value);

export const toZhModuleCode = (value?: unknown): string => formatText(MODULE_CODE_MAP, value);
