We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bfd109 commit 5434ca2Copy full SHA for 5434ca2
components/Stats/index.js
@@ -7,7 +7,9 @@ class Stats extends React.Component {
7
var template = this.props.template;
8
var data = {
9
nbHits: this.props.nbHits,
10
- isPlural: this.props.nbHits > 1,
+ hasNoResults: this.props.nbHits === 0,
11
+ hasOneResult: this.props.nbHits === 1,
12
+ hasManyResults: this.props.nbHits > 1,
13
processingTimeMS: this.props.processingTimeMS
14
};
15
widgets/stats/template.html
@@ -1,4 +1,6 @@
1
<div>
2
- {{nbHits}} {{#isPlural}}results{{/isPlural}}{{^isPlural}}result{{/isPlural}}
+ {{#hasNoResults}}No results{{/hasNoResults}}
3
+ {{#hasOneResult}}1 result{{/hasOneResult}}
4
+ {{#hasManyResults}}{{nbHits}} results{{/hasManyResults}}
5
<small>found in {{processingTimeMS}}ms</small>
6
</div>
0 commit comments