diff --git a/modules/motions/ui/MotionDescription/DescCSMSettleElStealingPenalty.tsx b/modules/motions/ui/MotionDescription/DescCSMSettleElStealingPenalty.tsx index 24150aad..c933d6db 100644 --- a/modules/motions/ui/MotionDescription/DescCSMSettleElStealingPenalty.tsx +++ b/modules/motions/ui/MotionDescription/DescCSMSettleElStealingPenalty.tsx @@ -1,4 +1,5 @@ import { CSMSettleElStealingPenaltyAbi } from 'generated' +import { pluralize } from 'modules/shared/utils/pluralize' import { NestProps } from './types' // CSMSettleElStealingPenalty @@ -7,8 +8,8 @@ export function DescCSMSettleElStealingPenalty({ }: NestProps) { return ( <> - Settle (confirm) EL Rewards Stealing penalty for the following CSM - operators: + Settle (confirm) EL Rewards Stealing penalty for the following CSM{' '} + {pluralize(callData.length, 'operator')}: {callData.map(item => { const nodeOperatorId = item.toNumber() diff --git a/modules/shared/utils/pluralize.ts b/modules/shared/utils/pluralize.ts new file mode 100644 index 00000000..2835690c --- /dev/null +++ b/modules/shared/utils/pluralize.ts @@ -0,0 +1,2 @@ +export const pluralize = (count: number, word: string) => + count === 1 ? word : `${word}s`