pluralize indicative in DegradedNotice comp

This commit is contained in:
slice 2018-07-16 18:18:14 -07:00
parent 31f171e94a
commit 7b7cc187e7
No known key found for this signature in database
GPG Key ID: 1508C19D7436A26D
1 changed files with 3 additions and 1 deletions

View File

@ -6,11 +6,13 @@ import './DegradedNotice.css'
const DegradedNotice = ({ services }) => {
const keys = Object.keys(services)
const serviceNames = keys.join(', ')
const plural = keys.length === 1 ? '' : 's'
const indicative = keys.length === 1 ? 'is' : 'are'
return (
<div className="degraded-notice">
<header>{keys.length} service{plural} are unreachable</header>
<header>{keys.length} service{plural} {indicative} unreachable</header>
<p>
elstat is having trouble contacting <strong>{serviceNames}</strong>.
</p>