export const useTask = () => {
  const types = ref<any>({
    // 0: { title: '团队任务', bg: '', bgClass: 'bg-gradient-to-r from-[#cfe0ff] to-[#e1ecff]' },
    1: {
      title: '团队任务',
      bg: '',
      bgClass: 'bg-gradient-to-r from-[#cfe0ff] to-[#e1ecff]',
      bgStyle: 'background: linear-gradient(90deg, #cfe0ff 2.55%, #e1ecff 99.52%);',
      color: '#2357e9',
    },
    2: {
      title: '抢单任务',
      bg: '',
      bgClass: 'bg-gradient-to-r from-[#ffcfcf] to-[#ffeae1]',
      bgStyle: 'background: linear-gradient(90deg, #ffcfcf 2.55%, #ffeae1 99.52%);',
      color: '#f04c47',
    },
    3: {
      title: '指定任务',
      bg: '',
      bgClass: 'bg-gradient-to-r from-[#ffe8cf] to-[#fff3e1]',
      bgStyle: 'background: linear-gradient(90deg, #ffe8cf 2.55%, #fff3e1 99.52%);',
      color: '#f89a2e',
    },
  })
  const getBgClass = (type: number) => types.value[type].bgClass
  return {
    types,
    getBgClass,
    getColor: (type: number) => types.value[type]?.color,
    getTypeTitle: (type: number) => types.value[type]?.title,
    getBgStyle: (type: number) => types.value[type]?.bgStyle,
  }
}
