Closed nabarvn closed 4 weeks ago
@nabarvn Good catch! This should ideally be encapsulated in a utility function like pluralize
. The function can also accept an optional plural?: string
parameter to accommodate words that have custom plural forms without the standard s
.
cc @steven-tey
Great idea, let's move this into a reusable function 👍
@unrenamed Thanks for the valuable suggestion!
Great idea, let's move this into a reusable function 👍
Roger that - is it okay if I add the reusable function in apps/web/lib/analytics/utils.ts
?
sure thing!
@steven-tey Appreciate you. 🤝
Current Behavior
The
AnalyticsBadge
component inlink-details-column.tsx
shows "clicks" as the label regardless of the count value. For example, when there is only 1 click, it still displays "1 clicks" which is grammatically incorrect.Expected Behavior
The label should dynamically change based on the count:
Proposed Solution
Replace the current label rendering:
with:
Contribution
I would like to work on this issue and submit a pull request with the potential fix. Please let me know if this approach sounds reasonable or if you have any suggestions for improvement.