import * as React from "react"; interface Props extends React.Props { current: number, total: number } export class Progress extends React.Component { render() { const {current, total} = this.props; let percent = total == 0 ? 100 : (current / total * 100); if (percent < 0) { percent = 0 }; var parentStyle = { textAlign: 'center', fontSize: '.6em', fontWeight: 'bold', color: 'white', border: '1px solid white', }; const childStyle = { backgroundColor: '#0BD318', width: percent + '%', transition: "width 200ms", padding: '5px 10px', }; return (
{this.props.children}
); } }