import React from 'react';
import { Icon } from 'antd';
import './index.less';
import Assets from '../Assets';

function Logo(props) {
  const { src, className, color, backgroundColor, icon, size = 50 } = props;
  return (
    <div className={`logo-wrapper ${className}`} style={{ width: size, height: size, lineHeight: `${size}px` }}>
      {src ? (
        <Assets src={src} />
      ) : (
        <div style={{ background: backgroundColor, lineHeight: `${size * 1.1}px` }} className="logo-item">
          {icon && <Icon style={{ color, fontSize: size / 2 }} type={icon} />}
        </div>
      )}
    </div>
  );
}
export default Logo;
