import React from 'react';
import IconFont from '../../themeComponents/IconFont';
import BetweenBox from '../../themeComponents/BetweenBox';
import './index.less';

function Title({ className = '', icon, title, style, children }) {
  return (
    <BetweenBox
      className={`lm-title-wrapper ${className}`}
      style={style}
      left={
        <span className="title-container">
          {icon && <IconFont className="icon-title" type={icon} />}
          {title}
        </span>
      }
      right={<span className="extra-container">{children}</span>}
    />
  );
}

export default Title;
