import { Button, Drawer,Space } from "antd"
import React from "react"
import AssetsMetaCompare from "./AssetsMetaCompare"
import config from "@/commons"

const {api:{asset}} = config

const AssetsCompareModal:React.FC<any>=(props)=>{

    const {visible,onCancel,item} = props

    const openexcel=()=>{
        window.open(`${asset}/dataAssetApi/exportDiffBetweenBusinessColumnAndMetadataColumn?dataAssetId=${item.id}`)
    }

    return(
        <Drawer
            title={'资源项对比'}
            visible={visible}
            width={'80%'}
            onClose={onCancel}
            extra={
                <Space>
                    <Button onClick={openexcel}>导出</Button>
                </Space>
            }
        >
            <AssetsMetaCompare item={item} />
        </Drawer>
    )
}

export default AssetsCompareModal