diff -r 000000000000 -r 5f4fcbc80b37 clientjs/packages/dashboard-components/src/ui/AnnotationsDocumentsTableRow.jsx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clientjs/packages/dashboard-components/src/ui/AnnotationsDocumentsTableRow.jsx Fri Sep 14 17:57:34 2018 +0200 @@ -0,0 +1,55 @@ +import _ from 'lodash'; + +import React, { Component } from 'react'; +import { FormattedRelative } from 'react-intl'; +import PropTypes from 'prop-types'; + +import Tag from './Tag'; + +export default class AnnotationsDocumentsTableRow extends Component { + tags() { + const { document, topics, metacategories } = this.props; + + const tags = _.chain(document.annotations) + .map('tags') + .flatten() + .uniq() + .value(); + + return tags.map(t => ); + } + + render() { + const { document, viaBaseUrl } = this.props; + + const { + uri, + name, + updated, + usersNb, + annotationsNb, + } = document; + + return ( + + + +

{ name }

+

{ this.tags() }

+ + { usersNb } + { annotationsNb } + + # + + + ); + } +} + +AnnotationsDocumentsTableRow.propTypes = { + document: PropTypes.object.isRequired, + metacategories: PropTypes.arrayOf(PropTypes.object).isRequired, + topics: PropTypes.arrayOf(PropTypes.string).isRequired, + viaBaseUrl: PropTypes.string.isRequired, +};