diff --git a/browser/main/NoteList/NoteItem.js b/browser/main/NoteList/NoteItem.js new file mode 100644 index 00000000..0f2fd43e --- /dev/null +++ b/browser/main/NoteList/NoteItem.js @@ -0,0 +1,95 @@ +/** + * @fileoverview Note item component. + */ +import React, { PropTypes } from 'react' +import { isArray } from 'lodash' +import CSSModules from 'browser/lib/CSSModules' +import styles from './NoteList.styl' + +/** + * @description Tag element component. + * @param {string} tagName + * @return {React.Component} + */ +const TagElement = ({ tagName }) => ( + + {tagName} + +) + +/** + * @description Tag element list component. + * @param {Array|null} tags + * @return {React.Component} + */ +const TagElementList = (tags) => { + if (!isArray(tags)) { + return [] + } + + const tagElements = tags.map(tag => ( + TagElement({tagName: tag}) + )) + + return tagElements +} + +/** + * @description Note item component when using normal display mode. + * @param {boolean} isActive + * @param {Object} note + * @param {Function} handleNoteClick + * @param {Function} handleNoteContextMenu + * @param {string} dateDisplay + */ +const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteContextMenu }) => ( +