/* eslint-disable */
import React from 'react';
const WxLogin = props => {
  let self_redirect = 'default';
  props.self_redirect === !0 ? (self_redirect = 'true')
    : props.self_redirect === !1 && (self_redirect = 'false');
  let url = `https://open.weixin.qq.com/connect/qrconnect?appid=${
    props.appid
  }&scope=${props.scope}&redirect_uri=${props.redirect_uri}&state=${
    props.state
    // eslint-disable-next-line camelcase
  }&login_type=jssdk&self_redirect=${self_redirect}&styletype=${props.styletype ||
    ''}&sizetype=${props.sizetype || ''}&bgcolor=${props.bgcolor ||
    ''}&rst=${props.rst || ''}`;
  url += props.style ? `&stylle=${props.style}` : '';
  url += props.href ? `&href=${props.href}` : '';
  return (
    // eslint-disable-next-line jsx-a11y/iframe-has-title
    <iframe
      frameBorder="0"
      scrolling="no"
      width="250px"
      height="245px"
      src={url}
    />
  );
};

export default WxLogin;
