All files / src/containers/PatientDetails/components/QuestionnarieList/baseline QuestionnarieStatusChip.js

0% Statements 0/19
0% Branches 0/4
0% Functions 0/3
0% Lines 0/19
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62                                                                                                                           
import React, { PureComponent } from 'react';
import Chip from '@material-ui/core/Chip';
import Tooltip from '@material-ui/core/Tooltip';
class QuestionnarieStatusChip extends PureComponent {
    constructor(props) {
        super(props);
        this.state = {
            tooltipMsg: ''
        };
    }
 
    changeColor = (progressStatus) => {
        switch (progressStatus) {
            case 1:
                this.setState({
                    tooltipMsg: 'Not Started'
                });
                break;
            case 2:
                this.setState({
                    tooltipMsg: 'In Progress'
                });
                break;
            case 3:
                this.setState({
                    tooltipMsg: 'Completed'
                });
                break;
            default:
                console.log('unknown category');
                break;
        }
    }
   
 
    
    render() {
        const {
            tooltipMsg 
        } = this.state;
        // console.log("QUESTIONNNAIRE PROPS=>",this.props)
        const {
            questionnaireType,
            rowdata: {
                progressStatus
            }
        } = this.props;
        
        return (   
            <div className="questinnaie-chip">
            <Tooltip title={tooltipMsg}>
                <Chip
                    label={questionnaireType}
                    className={"progressStatus"+progressStatus}
                />
                </Tooltip>
            </div>
        );
    }
}
export default QuestionnarieStatusChip;