var React = require('react');


var RibicaFormError = React.createClass({
    render: function() {
            var errorMessages = this.props.errorMessagesObject || {};
            var componentName = this.props.componentName;
            var message = errorMessages[componentName];
            if (message !== undefined && message !== null && message !== "") {
            return(<div className='error-message'>{message}</div>)
            }
            else return (<span></span>);
    }
});


module.exports = RibicaFormError;  
