import React from 'react';
import RaisedButton from 'material-ui/RaisedButton';

const CommentKeywordsContainer = props => (
	<div className="comment-keywords-container">
		{props.keywords.map(keyword => (
			<RaisedButton
				key={keyword._id}
				className="comment-keyword paper-shadow"
				onClick={props.keywordOnClick.bind(null, keyword)}
				data-id={keyword._id}
				label={(keyword.title || keyword.wordpressId)}
			/>
		))}
	</div>
);
CommentKeywordsContainer.propTypes = {
	keywords: React.PropTypes.arrayOf(React.PropTypes.shape({
		_id: React.PropTypes.string.isRequired,
		title: React.PropTypes.string,
		wordpressId: React.PropTypes.number,
	})).isRequired,
	keywordOnClick: React.PropTypes.func.isRequired,
};

export default CommentKeywordsContainer;

@@ -74,16 +74,175 @@
 tton';%0A%0A
+const getLabel = (keyword) =%3E %7B%0A%09let label = keyword.title %7C%7C keyword.wordpressId;%0A%09if (keyword.isMentionedInLemma) label = %60%5B $%7Blabel%7D %5D%60;%0A%09return label;%0A%7D;%0A%0A
 const Co
@@ -538,44 +538,23 @@
 el=%7B
-(keyword.title %7C%7C keyword.wordpressI
+getLabel(keywor
 d)%7D%0A

add brackets on keyword if isMentionedInLemma