import * as React from 'react';
import './index.scss';
interface Iprops {
  title: string;
  className?: string;
  titleMore?: JSX.Element;
  renderTitle?: JSX.Element;
}
const BoxWrapper: React.FC<Iprops> = (props) => {
  const { title, titleMore, children, className, renderTitle } = props;
  const titleClass = !!titleMore ? 'title-flex' : '';
  return (
    <div className={`box-wrapper ${className}`}>
      {!!renderTitle ? (
        renderTitle
      ) : (
        <div className={`box-title-wrapper ${titleClass}`}>
          <span className='box-title'>{title}</span>
          {titleMore}
        </div>
      )}

      <div className='box-content'> {children}</div>
    </div>
  );
};
export default BoxWrapper;
