Sha256: 9ad794f8ef14fcfaca381879a460d2a500f04dc078b849e1c985c92218468b8f
Contents?: true
Size: 749 Bytes
Versions: 1
Compression:
Stored size: 749 Bytes
Contents
var React = require('react'); import {capitalize} from 'lodash'; import {pluralize} from '../../utils'; export default React.createClass({ displayName: 'SearchGroupTitle', propTypes: { kind: React.PropTypes.string, items: React.PropTypes.array }, getDefaultProps() { return { kind: '', items: [] }; }, render() { return ( <span>{this.title()}</span> ); }, title() { var words = this.props.kind.replace(/[-_]/, ' ').split(' '); words[words.length - 1] = pluralize(words[words.length - 1]); return ( words.map(capitalize).join(' ') + ' (' + this.props.items.length + ')' ); } });
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
conjur-asset-ui-1.6.0 | app/src/components/search/group_title.js |