sudo-archive/src2/components/Progress.js

21 lines
612 B
JavaScript
Raw Normal View History

2021-07-13 22:31:37 +00:00
import React from 'react'
import './Progress.css'
// show: boolean
// progress: number
// steps: number
// text: string
// failed: boolean
export function Progress(props) {
return (
2021-08-07 18:42:56 +00:00
<div className={`progress ${props.show ? '' : 'hide'} ${props.failed ? 'failed' : ''}`}>
2021-07-13 22:31:37 +00:00
{ props.text && props.text.length > 0 ? (
<p>{props.text}</p>) : null}
<div className="bar">
<div className="bar-inner" style={{
width: (props.progress / props.steps * 100).toFixed(0) + "%"
}}/>
</div>
</div>
)
}