import ImmutablePropTypes from 'react-immutable-proptypes';
import React from 'react';
import Markdown from 'trc-client-core/src/components/Markdown';

var LearningPlanFooter = React.createClass({
    displayName: 'LearningPlanFooter',
    propTypes: {
        learningPlan: ImmutablePropTypes.map
    },
    render() {
        var {learningPlan} = this.props;

        if(!learningPlan) {
            return null;
        }

        return <div>
            {this.renderHeaderText()}
        </div>
    },
    renderHeaderText() {
        if(this.props.learningPlan.getIn(['displayText','headerText'])) {
            return <Markdown className="margin-top2 margin-bottom2" html={this.props.learningPlan.getIn(['displayText','headerText'])}/>;
        }
    }
});

module.exports = LearningPlanFooter;
