import { DelAdSysWarningRuleProps } from "@/services/adMonitor/earlyWarning"
import { Popconfirm } from "antd"
import React from "react"

function columns(del: (data: DelAdSysWarningRuleProps) => void) {
    const data: any = [
        { title: '广告账号', dataIndex: 'accountId', key: 'accountId', width: 120 },
        { title: '广告名称', dataIndex: 'adgroupName', key: 'adgroupName', ellipsis: true },
        { title: '广告ID', dataIndex: 'adgroupId', key: 'adgroupId', width: 120 },
        {
            title: '操作',
            dataIndex: 'cz',
            key: 'cz',
            width: 120,
            render: (a: string[], b: any) => {
                return <Popconfirm
                    title="确定删除?"
                    onConfirm={() => del(b)}
                >
                    <a style={{ color: 'red' }}>删除</a>
                </Popconfirm>
            }
        },
    ]
    return data
}

export function columnsAccount(del: (value: any) => void) {
    const data: any = [
        { title: '广告账号', dataIndex: 'accountId', key: 'accountId', width: 120 },
        { title: '腾讯备注', dataIndex: 'memo', key: 'memo', ellipsis: true },
        {
            title: '操作',
            dataIndex: 'cz',
            key: 'cz',
            width: 120,
            render: (a: string[], b: any) => {
                return <Popconfirm
                    title="确定删除?"
                    onConfirm={() => del(b)}
                >
                    <a style={{ color: 'red' }}>删除</a>
                </Popconfirm>
            }
        },
    ]
    return data
}

export function columnsBlack(del: (value: any) => void) {
    const data: any = [
        { title: '广告账号', dataIndex: 'accountId', key: 'accountId' },
        { title: '广告ID', dataIndex: 'adgroupId', key: 'adgroupId' },
        {
            title: '操作',
            dataIndex: 'cz',
            key: 'cz',
            width: 120,
            render: (a: string[], b: any) => {
                return <Popconfirm
                    title="确定删除?"
                    onConfirm={() => del(b)}
                >
                    <a style={{ color: 'red' }}>删除</a>
                </Popconfirm>
            }
        },
    ]
    return data
}

export default columns