import React, { Component } from 'react'; import classnames from 'classnames'; import _ from 'lodash'; export default class ChatTile extends Component { render() { const { props } = this; let data = _.get(props.data, 'chat-configs', false); let inviteNum = 0; let msgNum = 0; if (data) { Object.keys(data).forEach((conf) => { console.log(conf); msgNum = msgNum + data[conf].length - data[conf].read; }); } let invSuffix = (inviteNum === 1) ? ( Invite ) : ( Invites ); let numInvElem = (inviteNum > 0) ? (
{inviteNum} {invSuffix}
) : ( ); let msgSuffix = (msgNum === 1) ? ( New Message ) : ( New Messages ); let numMsgElem = (msgNum > 0) ? ({msgNum} {msgSuffix}
) : ( ); return ( ); } } window['chat-viewTile'] = ChatTile;