
import { formateLeftTime } from '@/utils/tools'

// 未开始
export const STATUS_READY = -1

// 进行中
export const STATUS_PROCESSING = 0

// 已结束
export const STATUS_OVER = 1

export function getPreText(tk, status) {
  return status === STATUS_OVER ? '已结束' : `距离 ${status === STATUS_READY ? '开始' : '结束'} 还有: `
}

export function getTkText(tk, status) {
  return status === STATUS_OVER ? '' : formateLeftTime(tk)
}

export function isFunction(fn) {
  return typeof fn === 'function'
}
