/**
 * Created by baoyinghai on 5/26/17.
 */
import React from 'react';

import { calculateStyle } from './common';

export default Comp => {

   class Layout extends React.Component {
   render() {
     const { layout, title = '此处应有标题', moveAble, moveStyle = {} } = this.props;
     let style = moveStyle;
     if (!moveAble) {
       style = calculateStyle(layout);
     }

     return (
       <div style={style} className="card-container">
         <div className="title-bar">
           <span>{title}</span>
         </div>
         <Comp key={this.props.index} {...this.props} width={style.width} height={style.height - 21} />
       </div>
     );
   }
  };

   return Layout;
}