import {Spin} from "antd";
import React from "react";


const LoadingBox = (props: any) => {
  return (
    <div
      style={{
        width: '100%',
        height: props.height?props.height:'30vh',
        background: 'rgba(0,0,0,0.1)',
        position: 'relative',
        zIndex: 5,
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center'
      }}
    >
      <div style={{
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        padding: '15px 20px 10px',
        background: '#fff',
        borderRadius: '8px',
        width: '200px',
        position: 'absolute',
        top: '50%',
        left: '50%',
        zIndex: 6,
        transform: 'translate(-50%,-50%)'
      }}>
        <Spin/>
        <span style={{marginLeft: '5px'}}>{props.loadingText?props.loadingText:'数据加载中...'}</span>
      </div>
    </div>
  )
}
export default LoadingBox
