/**
 * @description Loading 组件
 * @date 2018.01.10
 * @author abc
 */

import React from 'react'
import PropTypes from 'prop-types'
import { Spin } from 'antd';
import './style.scss'
const Loading = (props) => {
    if(props.type=='2'){
        return <div className="loading-wrapper-One">
            <Spin />
            <p style={{color: '#1890ff'}}>{props.title}</p>
        </div>
    }else{
        return <div className="wechat-loading-wrapper">
            <div className="line-scale">
                <div className="layui-layer-content">
                    <div style={{backgroundColor: props.color}}></div>
                    <div style={{backgroundColor: props.color}}></div>
                    <div style={{backgroundColor: props.color}}></div>
                    <div style={{backgroundColor: props.color}}></div>
                    <div style={{backgroundColor: props.color}}></div>
                </div>
            </div>
            <p style={{color: props.color}}>{props.title}</p>
        </div>
    }
}
// 默认props值
Loading.defaultProps = {
    title: '信息加载中...'
}
// props 类型
Loading.propTypes = {
    title: PropTypes.string
}
export default Loading

