Skip to content

Commit

Permalink
fix: pluralize csm motion title in description card
Browse files Browse the repository at this point in the history
  • Loading branch information
katamarinaki committed Sep 6, 2024
1 parent 98fe767 commit 9e20ef1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CSMSettleElStealingPenaltyAbi } from 'generated'
import { pluralize } from 'modules/shared/utils/pluralize'
import { NestProps } from './types'

// CSMSettleElStealingPenalty
Expand All @@ -7,8 +8,8 @@ export function DescCSMSettleElStealingPenalty({
}: NestProps<CSMSettleElStealingPenaltyAbi['decodeEVMScriptCallData']>) {
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()

Expand Down
2 changes: 2 additions & 0 deletions modules/shared/utils/pluralize.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const pluralize = (count: number, word: string) =>
count === 1 ? word : `${word}s`

0 comments on commit 9e20ef1

Please sign in to comment.