import { tableDfixed } from "@/utils/tableDfixed";
import { copy } from "@/utils/utils";
import { Badge } from "antd";
import { ColumnsType } from "antd/es/table";
export function UserTableConfig(): ColumnsType<any> {

    const arr: ColumnsType<any> = [
        {
            title: '成员id',
            dataIndex: 'userId',
            key: 'userId',
            width: 200,
            ellipsis: true,
            render: (a) => {
                return <a onClick={() => { copy(a) }}>{a}</a>
            }
        },
        {
            title: '成员名称',
            dataIndex: 'userName',
            key: 'userName',
            align: 'center',
            width: 80,
        },
        {
            title: '群内昵称',
            dataIndex: 'groupNickName',
            key: 'groupNickName',
            align: 'center',
            width: 80,
            render: (a, b) => {
                return a || b?.userName
            }
        },
        {
            title: '是否管理员',
            dataIndex: 'isManager',
            key: 'isManager',
            align: 'center',
            width: 80,
            render: (a) => {
                return <Badge text={a ? '是' : '否'} status={a ? 'success' : 'default'} />
            }
        },
        {
            title: '成员类型',
            dataIndex: 'userType',
            key: 'userType',
            align: 'center',
            width: 80,
        },
        {
            title: '入群方式',
            dataIndex: 'joinScene',
            key: 'joinScene',
            align: 'center',
            width: 80,
        },
        {
            title: '入群时间',
            dataIndex: 'joinTime',
            key: 'joinTime',
            align: 'center',
            width: 120,
        },
        {
            title: '邀请人名称',
            dataIndex: 'invitorUserName',
            key: 'invitorUserName',
            align: 'center',
            width: 80,
        },
    ]
    return arr
}