/** Pure component for each Note Item **/
import React from 'react';
import { ListItem } from 'react-native-elements';
import colors from '../../config/colors.json';

class NoteItem extends React.PureComponent {
  /**
  * Render method
  **/
  render() {
    const item = this.props.item;
    const title = new Date(item.uid).toLocaleDateString();
    const subTitle = item.note;

    return (
      <ListItem
        key={item.uid}
        title={title}
        subtitle={subTitle}
        titleStyle={styles.listItemTitleStyle}
        subtitleStyle={styles.listItemSubTitleStyle}
        subtitleNumberOfLines={0}
        hideChevron
      />
    );
  }
}

const styles = {
  listItemTitleStyle: {
    color: colors.middleGrey,
    fontSize: 13
  },
  listItemSubTitleStyle: {
    color: colors.black,
    fontWeight: 'normal'
  }
};

export default NoteItem;
