import React from "react"
import { GOAL_ROAS_ENUM, OPTIMIZATIONGOAL_ENUM } from "../../tencentAdPutIn/const"
import { TableProps } from "antd"
let columns = (): TableProps<any>['columns'] => [
    {
        title: '转化名称',
        dataIndex: 'conversionName',
        key: 'conversionName',
        ellipsis: true,
        render: (a: any, b: any) => {
            return <span style={{ fontSize: "12px" }}>{a}</span>
        }
    },
    {
        title: '优化目标',
        dataIndex: 'optimizationGoal',
        key: 'optimizationGoal',
        width: 100,
        align: 'center',
        ellipsis: true,
        render: (a: any) => {
            return <span style={{ fontSize: "12px" }}>{OPTIMIZATIONGOAL_ENUM[a as keyof typeof OPTIMIZATIONGOAL_ENUM]}</span>
        }
    },
    {
        title: '深度优化目标',
        dataIndex: 'deepBehaviorOptimizationGoal',
        key: 'deepBehaviorOptimizationGoal',
        width: 120,
        ellipsis: true,
        render: (a: any, b: any) => {
            return <span style={{ fontSize: "12px" }}>{a ? OPTIMIZATIONGOAL_ENUM[a as keyof typeof OPTIMIZATIONGOAL_ENUM] : b?.deepWorthOptimizationGoal ? GOAL_ROAS_ENUM[b?.deepWorthOptimizationGoal as keyof typeof GOAL_ROAS_ENUM] : null}</span>
        }
    },
    {
        title: '上报类型',
        dataIndex: 'createSourceType',
        key: 'createSourceType',
        width: 100,
        render: (a: any, b: any) => {
            return <span style={{ fontSize: "12px" }}>{a === 'SELF_CREATED' ? '自建转化' : a === 'PLATFORM' ? '平台类转化' : ''}</span>
        }
    }
]

export default columns