import { PageStatusEnum, PageTypeEnum, SourceTypeEnum } from '@/services/launchAdq/enum'
import React from 'react'
import { Badge, Space } from 'antd'
import { copy } from '@/utils/utils'
import { CopyOutlined } from '@ant-design/icons'
function tableConfig(tableIdClick: any): any {
    return [
        {
            title: '所属账号',
            dataIndex: 'accountId',
            key: 'accountId',
            align: 'center',
            width: 100,
            ellipsis: true,
            render: (a: string) => {
                return <Space>
                    <a onClick={() => copy(a)} >{a}</a>
                </Space>
            }
        },
        {
            title: '落地页ID',
            dataIndex: 'pageId',
            key: 'pageId',
            align: 'center',
            width: 100,
            ellipsis: true,
            render: (a: string) => {
                return <a onClick={() => copy(a)}>{a}</a>
            }
        },
        {
            title: '落地页名称',
            dataIndex: 'pageName',
            key: 'pageName',
            align: 'center',
        },
        // {
        //     title: '原生页类型',
        //     dataIndex: 'canvasType',
        //     key: 'canvasType',
        //     align: 'center',
        //     width:110,
        //     render: (a: string | number) => {
        //         return CanvasTypeEnum[a]
        //     }
        // },
        {
            title: '落地页类型',
            dataIndex: 'pageType',
            key: 'pageType',
            align: 'center',
            width: 110,
            render: (a: string) => {
                return PageTypeEnum[a]
            }
        },
        {
            title: '落地页状态',
            dataIndex: 'pageStatus',
            key: 'pageStatus',
            align: 'center',
            width: 90,
            render: (a: string | number) => {
                return <Badge status={a === 'NORMAL' ? "processing" : "error"} text={PageStatusEnum[a]} />
            }
        },
        {
            title: '配置来源',
            dataIndex: 'sourceType',
            key: 'sourceType',
            align: 'center',
            width: 110,
            render: (a: any, b: any) => {
                return SourceTypeEnum[a]
            }
        },
        // {
        //     title: '微信原生页视频资源状态',
        //     dataIndex: 'videoResourceStatus',
        //     key: 'videoResourceStatus',
        //     align: 'center',
        //     width:160,
        //     render: (a: any, b: any) => {
        //         return  <Badge status={a === 'VIDEO_RESOURCE_STATUS_VALID' ? "processing" :a === 'VIDEO_RESOURCE_STATUS_PENDING'? "warning" :"error" } text={VideoResourceStatusEnum[a]} />
        //     }
        // },
        {
            title: '创建时间',
            dataIndex: 'createdTime',
            key: 'createdTime',
            align: 'center',
            width: 160,
        },
    ]
}
export default tableConfig