import React, { PropTypes } from 'react'; import moment from 'moment'; import { Avatar } from 'rebass'; import { Flex } from 'reflexbox'; import styles from './PublishingInfo.scss'; class PublishingInfo extends React.Component { static propTypes = { collaborators: PropTypes.array.isRequired, createdAt: PropTypes.string.isRequired, createdBy: PropTypes.object.isRequired, updatedAt: PropTypes.string.isRequired, updatedBy: PropTypes.object.isRequired, }; render() { return ( { this.props.collaborators.reverse().map(user => ( )) } { this.props.createdBy.name } published { moment(this.props.createdAt).fromNow() } { this.props.createdAt !== this.props.updatedAt ? (  and  { this.props.createdBy.id !== this.props.updatedBy.id && ` ${this.props.updatedBy.name} ` } modified { moment(this.props.updatedAt).fromNow() } ) : null } ); } } export default PublishingInfo;