const React = require('react'); const createClass = require('create-react-class'); const _ = require('lodash'); const Moment = require('moment'); const Nav = require('naturalcrit/nav/nav.jsx'); const MetadataNav = createClass({ DisplayName : 'MetadataNav', getDefaultProps : function() { return { }; }, getInitialState : function() { return { showMetaWindow : false }; }, componentDidMount : function() { }, toggleMetaWindow : function(){ this.setState((prevProps)=>({ showMetaWindow : !prevProps.showMetaWindow })); }, getAuthors : function(){ if(!this.props.brew.authors) return 'No authors'; return this.props.brew.authors.join(', '); }, getTags : function(){ if(this.props.brew.tags.length == 0) return 'No tags'; return <> {this.props.brew.tags.map((tag, idx)=>{ return {tag}; })} >; }, getSystems : function(){ if(!this.props.brew.systems) return 'No systems'; return this.props.brew.systems.join(', '); }, renderMetaWindow : function(){ return
{this.props.brew.description || 'No description.'}
{this.getAuthors()}
{this.getTags()}
{this.getSystems()}
{Moment(this.props.brew.updatedAt).fromNow()}