import { Statistic } from "antd";
import { AnyObject } from "antd/es/_util/type"
import { ColumnsType } from "antd/es/table"


export const Columns1 = (): ColumnsType<AnyObject> => {

    return [
        {
            title: '企业名称',
            dataIndex: 'corp_name',
            key: 'corp_name',
            ellipsis: true,
            width: 150,
        },
        {
            title: '企业ID',
            dataIndex: 'corp_id',
            key: 'corp_id',
            ellipsis: true,
            width: 120
        },
        {
            title: '总粉丝数',
            dataIndex: 'total_num',
            key: 'total_num',
            align: 'center',
            render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
        },
        {
            title: '净值粉丝数',
            dataIndex: 'only_num',
            key: 'only_num',
            align: 'center',
            render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
        },
        {
            title: '未识别粉丝数',
            dataIndex: 'qc_null_num',
            key: 'qc_null_num',
            align: 'center',
            render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
        },
        {
            title: '净值比',
            dataIndex: 'only_rate',
            key: 'only_rate',
            align: 'center',
            render: (text: any) => <Statistic
                value={text ? text * 100 : 0}
                valueStyle={text < 0.8 ? { color: '#cf1322', fontSize: 12 } : { color: '#3f8600', fontSize: 12 }}
                suffix="%"
                precision={2}
            />
        }
    ]
}