Total Complexity | 2 |
Complexity/F | 2 |
Lines of Code | 27 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /** |
||
4 | import { Component } from '@wordpress/element'; |
||
5 | |||
6 | /** |
||
7 | * Internal dependencies. |
||
8 | */ |
||
9 | import { ProgressCircle } from './progress-circle'; |
||
10 | import { ProgressBar } from './progress-bar'; |
||
11 | |||
12 | export class FundraisingProgress extends Component { |
||
13 | render () { |
||
14 | let { color, style, value } = this.props; |
||
15 | |||
16 | let Progress; |
||
17 | |||
18 | switch ( style ) { |
||
19 | case 'circle': |
||
20 | Progress = new ProgressCircle( value, color ); |
||
21 | |||
22 | break; |
||
23 | case 'bar': |
||
24 | default: |
||
25 | Progress = new ProgressBar( value, color ); |
||
26 | } |
||
27 | |||
28 | return Progress.render(); |
||
29 | } |
||
30 | } |