import React from 'react';
import PropTypes from 'prop-types';
import Typography from '@material-ui/core/Typography';

export class RuleComponent extends React.Component {
    static propTypes = {
        classes: PropTypes.object,
        result: PropTypes.object,
    };

    ruleType = null;

    constructor(props) {
        super(props);

        if (props.result && props.result.rule_type) {
            this.ruleType = props.result.rule_type;
        }
    }

    renderRules() {
        const { result } = this.props;
        return <Typography>{result.message}</Typography>;
    }

    render() {
        const { classes } = this.props;
        return <div className={classes.incompatibilityRule}>{this.renderRules()}</div>;
    }
}

export default RuleComponent;
