import React from "react"
import { Image } from "antd"
let columns = () => [
    {
        title: '落地页名称',
        dataIndex: 'name',
        key: 'name',
        align: 'center',
        render: (a: any, b: any) => {
            return <span style={{fontSize: "12px"}}>{a}</span>
        }
    },
    {
        title: '分享标题',
        dataIndex: 'typesetting',
        key: 'typesetting',
        align: 'center',
        render: (a: any, b: any) => {
            if(a){
                a = JSON.parse(a)
                let shareTittle = a?.shareTittle
                return <span style={{fontSize: "12px"}}>{shareTittle}</span>
            }else{
                return null
            }
        }
    },
    {
        title: '分享描述',
        dataIndex: 'typesetting',
        key: 'typesetting',
        align: 'center',
        render: (a: any, b: any) => {
            if(a){
                a = JSON.parse(a)
                let shareDesc = a?.shareDesc
                return <span style={{fontSize: "12px"}}>{shareDesc}</span>
            }else{
                return null
            }
        }
    },
    {
        title: '页面背景色',
        dataIndex: 'typesetting',
        key: 'typesetting',
        align: 'center',
        render: (a: any, b: any) => {
            if(a){
                a = JSON.parse(a)
                let pageBackColor = a?.pageBackColor
                return <span style={{fontSize: "12px"}}>{pageBackColor}</span>
            }else{
                return null
            }
        }
    },
    {
        title: '顶部素材预览',
        dataIndex: 'typesetting',
        key: 'typesetting',
        align: 'center',
        render: (a: any, b: any) => {
            if(a){
                a = JSON.parse(a)
                let topContent = a?.topContent
                if(topContent?.type === 'topImg'){
                    return <Image width={30} height={30} src={topContent?.content?.url}/>
                }else{
                    return "空"
                }
            }else{
                return null
            }
        }
    },
    // {
    //     title: '适用推广目标',
    //     dataIndex: 'protagonist',
    //     key: 'protagonist',
    //     align: 'center',
    //     render: (a: any, b: any) => {
    //         return <span style={{fontSize: "12px"}}>{a}</span>
    //     }
    // },
    {
        title: '创建时间',
        dataIndex: 'createTime',
        key: 'createTime',
        align: 'center',
        render: (a: any, b: any) => {
            return <>
                {a && <span style={{fontSize: "12px"}}>{a}</span>}
            </>
        }
    },
    {
        title: '最后修改时间',
        dataIndex: 'updateTime',
        key: 'updateTime',
        align: 'center',
        render: (a: any, b: any) => {
            return <>
                {a && <span style={{fontSize: "12px"}}>{a}</span>}
            </>
        }
    },
]

export default columns