import type { SelectOption } from 'naive-ui'
import { transformRecordToOption } from '@/utils/common'

export const enableStatusRecord: Record<Api.Common.EnableStatus, string> = {
  1: '启用',
  2: '禁用',
}

export const enableStatusOptions: SelectOption[] = transformRecordToOption(enableStatusRecord) as unknown as SelectOption[]

export const userGenderRecord: Record<Api.SystemManage.UserGender, string> = {
  1: '男',
  2: '女',
}

export const userGenderOptions: SelectOption[] = transformRecordToOption(userGenderRecord) as unknown as SelectOption[]

export const menuTypeRecord: Record<Api.SystemManage.MenuType, string> = {
  1: '目录',
  2: '菜单',
}

export const menuTypeOptions: SelectOption[] = transformRecordToOption(menuTypeRecord) as unknown as SelectOption[]

export const menuIconTypeRecord: Record<Api.SystemManage.IconType, string> = {
  1: 'iconify',
  2: '本地图标',
}

/**
 * 题目分数类型
 */
export const scoreTypeRecord: Record<Api.Competition.QuestionScoreType, string> = {
  1: '固定分数',
  2: '答题个数',
}

/**
 * 轮次类型
 */
export const roundTypeRecord: Record<Api.Competition.CompetitionRoundType, string> = {
  1: '题包环节',
  2: '加时环节',
}

export const uiTypeRecord: Record<Api.Competition.QuestionTemplateId, string> = {
  TEMPLATE_DICTATION_HINT: '汉字听写-提示',
  TEMPLATE_DICTATION_HOMOPHONE: '汉字听写-同音',
  TEMPLATE_COMPONENT_ADD: '汉字加一加',
  TEMPLATE_WORD_DICTATION: '词语听写',
  TEMPLATE_IDIOM_TEXT_REQ: '成语-文字要求',
  TEMPLATE_IDIOM_IMAGE: '成语-看图',
}

export const timeRecord: Record<Api.Competition.QuestionTimeType, string> = {
  5: '5s',
  10: '10s',
  15: '15s',
  20: '20s',
  30: '30s',
  45: '45s',
  60: '60s',
  90: '90s',
}

export const timeOptions: SelectOption[] = transformRecordToOption(timeRecord) as unknown as SelectOption[]

export const uiTypeOptions: SelectOption[] = transformRecordToOption(uiTypeRecord) as unknown as SelectOption[]

export const roundTypeOptions: SelectOption[] = transformRecordToOption(roundTypeRecord) as unknown as SelectOption[]

export const scoreTypeOptions: SelectOption[] = transformRecordToOption(scoreTypeRecord) as unknown as SelectOption[]

export const menuIconTypeOptions: SelectOption[] = transformRecordToOption(menuIconTypeRecord) as unknown as SelectOption[]
