diff --git a/client/src/core-components/tag-selector.js b/client/src/core-components/tag-selector.js new file mode 100644 index 00000000..5a342ec3 --- /dev/null +++ b/client/src/core-components/tag-selector.js @@ -0,0 +1,39 @@ +import React from 'react'; +import _ from 'lodash'; +import Icon from 'core-components/icon'; + +class TagSelector extends React.Component { + + static propTypes = { + items: React.PropTypes.arrayOf(React.PropTypes.shape({ + name: React.PropTypes.string, + color: React.PropTypes.string + })), + values: React.PropTypes.arrayOf(React.PropTypes.string) + }; + + render() { + return ( +
+
+

Tags

+
{this.renderItemsList()}
+
+
{this.props.values.join()}
+
+ ); + } + renderItemsList() { + const itemList = _.filter(this.props.items,(item) => !_.includes(this.props.values,item.name)); + console.log('la lista de items librs',itemList); + return itemList.map((item,index) => { + return( + + {item.name} + x + + ) + }); + } +} +export default TagSelector;