import ReactIframe from 'react-iframe';
import React, { useContext } from 'react';
import { IIframeProps } from './types';
import './style.less';
import { ConfigProvider } from 'antd';
import classnames from 'classnames';

const IFrame = (props: IIframeProps) => {
  const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
  const prefixCls = getPrefixCls('btri-iframe');
  return (
    <ReactIframe
      {...props}
      className={classnames(prefixCls, props.className)}
    ></ReactIframe>
  );
};

export { IFrame };
