import React,{useMemo} from "react"
import styles from "./index.module.less"
import {Table} from "antd"
import ScrollTable from "@/component/scrolltable";

interface bodyprops{
    topPanel:any;
    bodyPanel:any;
    pagePanel:any;
}

const ActionBodyPanel:React.FC<bodyprops>=(props)=>{

    const {topPanel,bodyPanel,pagePanel} = props

    const columns:any = useMemo(()=>{
        let list:Array<any> = [
            {
                title:'序号',
                key:'index',
                width:80,
                resize:true,
            },
            {
                title:'字段英文名称',
                key:'name',
                dataIndex:'name',
                ellipsis:true,
                resize:true,
            },
            {
                title:'字段中文名称',
                key:'cnName',
                dataIndex:'cnName',
                ellipsis:true,
                resize:true,
                render:(text:any,record:any)=>{
                    return ''
                }
            },
            {
                title:'字段说明',
                key:'description',
                dataIndex:'description',
                ellipsis:true,
                resize:true,
                render:(text:any,record:any)=>{
                    return ''
                }
            },
            {
                title:'表英文名称',
                key:'parentName',
                dataIndex:'parentName',
                ellipsis:true,
                resize:true,
                render:(text:any,record:any)=>{
                    try {
                        return ''
                    } catch (error) {
                        return ''
                    }
                }
            },
            {
                title:'表中文名称',
                key:'parentCnName',
                dataIndex:'parentCnName',
                ellipsis:true,
                resize:true,
                render:(text:any,record:any)=>{
                    try {
                        return ''
                    } catch (error) {
                        return ''
                    }
                }
            },
            {
                title:'表说明',
                key:'parentDescription',
                dataIndex:'parentDescription',
                ellipsis:true,
                resize:true,
                render:(text:any,record:any)=>{
                    try {
                        return ''
                    } catch (error) {
                        return ''
                    }
                }
            },
            {
                title:'标签',
                key:'tag',
                ellipsis:true,
                width:200,
                resize:true,
            },
        ]
        return list
    },[])

    return(
        <>
            <div className={styles.inputpanel}>
                <div>
                    {topPanel}
                </div>
            </div>
            <div className={styles.maintable}>
            {/* <ScrollTable
                pagination={false}
                columns={columns}
                components={{}}
                resize={true}
                virtual={true}
                otherwidth={50}
                size="middle"
            /> */}
                {bodyPanel}
            </div>
            <div className={styles.mainpage}>
                {pagePanel}
            </div> 
        </>
    )
}

export default ActionBodyPanel