import * as React from "react";
import PropTypes from 'prop-types';


type defaultProps = {
    bgColor: "#457305",//背景颜色，16进制
    spaceStyle: 1,//边距，1是无边距，2是左右留边
    style: 1,//虚实线，1是实线，2是虚线，3是点线
}

type ContentData = {
    bgColor: string,//背景颜色，16进制
    spaceStyle: number,//边距，1是无边距，2是左右留边
    style: number,//虚实线，1是实线，2是虚线，3是点线
} & defaultProps

interface LPData {
    content: Array<ContentData>,

    [propsName: string]: any
}

interface LPType {
    content: any,

    [propsName: string]: any
}

type IPropTypes = {
    source?: ContentData,
    [propsName: string]: any
}


const CLASS = 'm-block-';
let audioTimer, audioT, playAudio, audio, myAuto

class MPro extends React.Component<IPropTypes, any> {
    state: any;

    constructor(props: IPropTypes) {
        super(props);

        this.state = {}

    }

    componentDidMount(): void {


    }

    componentWillUnmount() {

    }


    render() {
        let source = this.props;
        let content = source;
        return (
            <div className={''}>
                {
                    content ? <div className={CLASS + 'bg'}
                                   style={{
                                       background: content.bgColor,
                                       // margin: content.spaceStyle == 2 ? "0 10px" : 0,
                                       height: content.height+"px"
                                   }}
                    ></div> : ""
                }
            </div>
        );
    }
}

export default MPro;