(props)
| 1 | import React from "react"; |
| 2 | import './ChartBar.css'; |
| 3 | function ChartBar(props){ |
| 4 | let barFillHeight='0%'; |
| 5 | if (props.maxValue>0){ |
| 6 | barFillHeight=Math.round((props.value/props.maxValue)*100)+'%'; |
| 7 | } |
| 8 | |
| 9 | |
| 10 | return ( |
| 11 | <div className="chart-bar"> |
| 12 | <div className="chart-bar__inner"> |
| 13 | <div className="chart-bar__fill" style={{height:barFillHeight}}></div> |
| 14 | </div> |
| 15 | <div className="chart-bar__label">{props.label}</div> |
| 16 | </div> |
| 17 | |
| 18 | |
| 19 | ); |
| 20 | |
| 21 | |
| 22 | } |
| 23 | export default ChartBar; |
nothing calls this directly
no outgoing calls
no test coverage detected