import { Space, Image, Popconfirm, TableProps } from "antd"
import React from "react"


const profilesColumns = (del: (id: number) => void): TableProps<any>['columns'] => {


    const data: TableProps<any>['columns'] = [
        {
            title: '操作',
            dataIndex: 'cz',
            key: 'cz',
            align: 'center',
            width: 70,
            render: (_, b) => {
                return <Space>
                    <Popconfirm
                        title="确定删除?"
                        onConfirm={() => del(b.id)}
                        okText="是"
                        cancelText="否"
                    >
                        <a style={{ color: 'red', fontSize: 12 }}>删除</a>
                    </Popconfirm>
                </Space>
            }
        },
        {
            title: 'ID',
            dataIndex: 'id',
            key: 'id',
            width: 60,
            align: 'center',
            render: (a) => {
                return <span style={{ fontSize: "12px" }}>{a}</span>
            }
        },
        {
            title: '头像预览图',
            dataIndex: 'headImageUrl',
            key: 'headImageUrl',
            width: 100,
            align: 'center',
            render: (a) => {
                return <Image width={25} style={{ borderRadius: 4 }} src={a} />
            }
        },
        {
            title: '昵称',
            dataIndex: 'profileName',
            key: 'profileName',
            render: (a) => {
                return <span style={{ fontSize: "12px" }}>{a}</span>
            }
        },
        {
            title: '详细描述',
            dataIndex: 'description',
            key: 'description',
            render: (a) => {
                return <span style={{ fontSize: "12px" }}>{a}</span>
            }
        },
        {
            title: '创建时间',
            dataIndex: 'createTime',
            key: 'createTime',
            align: 'center',
            width: 140,
            render: (a) => {
                return <span style={{ fontSize: "12px" }}>{a}</span>
            }
        }
    ]

    return data
}

export default profilesColumns