Function
QueryCount
({count, max, hideIfEmpty = true, hideParens = false}: Props)
Source from the content-addressed store, hash-verified
| 15 | */ |
| 16 | |
| 17 | export function QueryCount({count, max, hideIfEmpty = true, hideParens = false}: Props) { |
| 18 | const countOrMax = defined(count) && defined(max) && count >= max ? `${max}+` : count; |
| 19 | |
| 20 | if (hideIfEmpty && !count) { |
| 21 | return null; |
| 22 | } |
| 23 | |
| 24 | return ( |
| 25 | <span> |
| 26 | {!hideParens && <span>(</span>} |
| 27 | <span>{countOrMax}</span> |
| 28 | {!hideParens && <span>)</span>} |
| 29 | </span> |
| 30 | ); |
| 31 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected