import { ColumnsType } from "antd/es/table"
import BindDetails from "./bindDetails"
import { STATUSENUM } from "."


export function GroupLeaderTableConfig(): ColumnsType<any> {

    const arr: ColumnsType<any> = [
        {
            title: '群主主体',
            dataIndex: 'corpName',
            key: 'corpName',
            align: 'center',
            width: 70,
            ellipsis: true,
        },
        {
            title: '群主企微主体ID',
            dataIndex: 'corpId',
            key: 'corpId',
            align: 'center',
            width: 70,
            ellipsis: true,
        },
        {
            title: '群主企微号',
            dataIndex: 'name',
            key: 'name',
            align: 'center',
            width: 70,
            ellipsis: true,
        },
        {
            title: '群主企微号ID',
            dataIndex: 'corpUserId',
            key: 'corpUserId',
            align: 'center',
            width: 70,
            ellipsis: true,
        },
        {
            title: '主运营',
            dataIndex: 'operUser',
            key: 'operUser',
            align: 'center',
            width: 70,
            ellipsis: true,
            render: (value) => {
                return value?.nickname || '--'
            }
        },
        {
            title: '投手',
            dataIndex: 'putUser',
            key: 'putUser',
            align: 'center',
            width: 70,
            ellipsis: true,
            render: (value) => {
                return value?.nickname || '--'
            }
        },
        {
            title: '运营助理',
            dataIndex: 'userList',
            key: 'userList',
            width: 120,
            ellipsis: true,
            render: (value) => {
                return value?.map(item => item.nickname)?.join('、') || '--'
            }
        },
        {
            title: '状态',
            dataIndex: 'status',
            key: 'status',
            width: 70,
            align: 'center',
            render: (value) => {
                return STATUSENUM[value]
            }
        },
        {
            title: '绑定客服号',
            dataIndex: 'bindCorpUser',
            key: 'bindCorpUser',
            width: 70,
            align: 'center',
            render: (_, record) => {
                return <BindDetails data={record} bindType={1}/>
            }
        },
        {
            title: '绑定机器人客服号',
            dataIndex: 'bindACorpUser',
            key: 'bindACorpUser',
            width: 70,
            align: 'center',
            render: (_, record) => {
                return <BindDetails data={record} bindType={2}/>
            }
        },
    ]
    return arr
}