import * as React from 'react';
import { Row, Col, Progress } from 'antd';

interface ProItemProps {
    who: string;
    percent: number;
    description: string;
    maxString: string;
}

class ProgressBar extends React.Component<ProItemProps, {}> {

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

    }

    render() {
        const { who, percent, description, maxString  } = this.props;

        return (
            <div>
                <Row className="probar">
                        <Col span={6}>
                            <div className="name">{who}</div>
                        </Col>
                        <Col span={17} className="bar">
                            <div className="showProgress">
                                <Progress
                                    percent={percent}
                                    strokeWidth={30}
                                    // strokeLinecap={'square'}
                                    format={() => description}
                                />
                            </div>
                            <Row className="description">
                                <Col span={12}>0</Col>
                                <Col className="right" span={12}>{maxString}</Col>
                            </Row>
                        </Col>
                    </Row>
                    <br/>
            </div>
        );
    }
}

export default ProgressBar;