Skip to content

Commit 48eef83

Browse files
jdonelsonclaude
andcommitted
console: Use one count format in the freshness headers
The three section headers read "12 objects", "(3/12)" and "(12)". They are all parenthesised now. Exceeding threshold keeps its ratio, which is what that section is about. The headline pluralises with the shared helper rather than a ternary. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent 10c1330 commit 48eef83

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎console/src/platform/freshness/FreshnessPage.tsx‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import {
5151
import { useAllClusters } from "~/store/allClusters";
5252
import { useAllObjects } from "~/store/allObjects";
5353
import { MaterializeTheme } from "~/theme";
54+
import { pluralize } from "~/util";
5455
import { formatDurationExact, formatDurationForAxis } from "~/utils/format";
5556

5657
import { OBJECT_TYPE_FILTERS, TIME_PERIOD_OPTIONS } from "./constants";
@@ -170,15 +171,13 @@ const FreshnessContent = ({
170171
<Text as="span" textStyle="text-ui-med">
171172
{breaching.length} of {rows.length}
172173
</Text>{" "}
173-
{rows.length === 1 ? "object" : "objects"} exceeded {thresholdClause}.
174+
{pluralize(rows.length, "object", "objects")} exceeded {thresholdClause}
175+
.
174176
</Text>
175177

176178
<Accordion allowMultiple defaultIndex={[0, 1]}>
177179
<AccordionItem>
178-
<SectionHeader
179-
title="Freshness"
180-
count={`${rows.length} ${rows.length === 1 ? "object" : "objects"}`}
181-
/>
180+
<SectionHeader title="Freshness" count={`(${rows.length})`} />
182181
<AccordionPanel px="0">
183182
<ThresholdLineGraph<DataPoint>
184183
data={historicalData}

0 commit comments

Comments
 (0)