import {
    WeaFormItem,
} from 'ecCom'

import {
    Spin,
    Button,
} from 'antd'

import {
    i18n
} from '../../public/i18n';

import '../../style/common.less';
import { chunk } from 'lodash';

export default class IframeItem extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
        }
    }

    render() {
        const {
            iframeInfo,userid
        } = this.props, {
        } = this.state;

        return (
            <div className='iframe-item' id={iframeInfo.id} >
                <div className='title'>
                    <div></div>
                    <p>{iframeInfo.title}</p>
                </div>
                <div className='content' >
                  <iframe 
                    id={iframeInfo.id+"-iframe"}
                    src={iframeInfo.url.replaceAll("{#id}",userid)} 
                    width="100%" 
                    height="500px" 
                    frameBorder="0" 
                    scrolling="auto"
                    onLoad={() => {
                        // console.log(document.getElementById(iframeInfo.id+"-iframe").scrollHeight)
                        // document.getElementById(iframeInfo.id+"-iframe").height = 500 + "px"
                    }}
                  />                 
                </div>

            </div>
        )
    }
}
