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

function Block(props) {
  const { className = '', full = false, center = false, flex = false, color = '#fff', loading = false } = props;
  return (
    <div
      className={`block ${className} ${loading ? 'loading' : ''} ${full ? 'full' : ''} ${center ? 'center' : ''} ${
        flex ? 'flex' : ''
      }`}
      style={{ backgroundColor: color }}
    >
      {props.children}
      {loading && <div className="mask" />}
      {loading && <Spin size="large" />}
    </div>
  );
}
Block.propTypes = {};
export default Block;
