import React from 'react';
export default class RelatedAppsBannerIframe extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {
            width: 210,
            height: 260
        };
    }
    updateFrameDimensions() {
        const { iframe } = this;
        this.setState({
            width: iframe.contentWindow.document.body.scrollWidth,
            height: iframe.contentWindow.document.body.scrollHeight
        });
    }
    componentDidMount() {
        this.iframe.addEventListener('load', this.updateFrameDimensions.bind(this));
    }
    render() {
        let url = `${PAGES_BASE_PATH}/pages/related-apps-banner?utm_source=cf-dashboard`;
        url += this.props.categories.map(category => `&app-category=${category}`);
        return React.createElement("iframe", { ref: (iframe) => this.iframe = iframe, src: url, seamless: true, width: this.state.width, height: this.state.height, frameBorder: '0', style: { backgroundColor: 'transparent', border: '0 none transparent', padding: 0 } });
    }
}
//# sourceMappingURL=related-apps-banner-iframe.js.map