export function getUploadFileAction(row) {
  if (row.sourceType === "HISTORY_IMPORT") {
    return null
  }

  const actionMap = {
    parsed_failed: { key: "viewError", text: "查看错误原因" },
    parsed_success: { key: "delete", text: "删除" }
  }

  return actionMap[row.fileStatus] || null
}

export function getUploadFileStatusText(status) {
  const map = {
    uploading: "上传中",
    parsing: "解析中",
    parsed_success: "解析成功",
    parsed_failed: "解析失败",
    deleted: "已删除"
  }

  return map[status] || status
}

export function getUploadFileStatusType(status) {
  const map = {
    uploading: "primary",
    parsing: "warning",
    parsed_success: "success",
    parsed_failed: "danger",
    deleted: "info"
  }

  return map[status] || "info"
}
