const platform = {
  'ios-school': '苹果-管理端',
  'ios-teacher': '苹果-老师端',
  'ios-student': '苹果-学生端',
  'android-school': '安卓-管理端',
  'android-teacher': '安卓-老师端',
  'android-student': '安卓-学生端'
}

const status = {
  newest: '最新',
  history: '历史',
  auditing: '审核中'
}

export const platformArr = [
  { value: 'ios-school', label: '苹果-管理端' },
  { value: 'ios-teacher', label: '苹果-老师端' },
  { value: 'ios-student', label: '苹果-学生端' },
  { value: 'android-school', label: '安卓-管理端' },
  { value: 'android-teacher', label: '安卓-老师端' },
  { value: 'android-student', label: '安卓-学生端' }
]

export const statusArr = [
  { value: 'newest', label: '最新' },
  { value: 'history', label: '历史' },
  { value: 'auditing', label: '审核中' }
]

export const filterStatus = (key: 'newest' | 'history' | 'auditing' | '') => {
  if (key && status && status[key]) {
    return status[key]
  } else {
    return key
  }
}

export const filterPlatform = (
  key:
    | 'ios-school'
    | 'ios-teacher'
    | 'ios-student'
    | 'android-school'
    | 'android-teacher'
    | 'android-student'
    | ''
) => {
  if (key && platform && platform[key]) {
    return platform[key]
  } else {
    return key
  }
}
