const React = require('react'); const _ = require('lodash'); const cx = require('classnames'); const Moment = require('moment'); //TODO: Add in delete const BrewTable = React.createClass({ getDefaultProps: function() { return { brews : [] }; }, renderRows : function(){ return _.map(this.props.brews, (brew) => { let authors = 'None.'; if(brew.authors && brew.authors.length) authors = brew.authors.join(', '); return {brew.title} {authors} {brew.editId} {brew.shareId} {Moment(brew.updatedAt).fromNow()} {brew.views} }); }, render: function(){ return {this.renderRows()}
Title Authors Edit Link Share Link Last Updated Views Remove
} }); module.exports = BrewTable;