Skip to content

Commit

Permalink
πŸ“Š Add a unit prop to the Numeric proposal details renderer (#4821)
Browse files Browse the repository at this point in the history
Add a unit prop to the `Numeric` proposal details renderer
  • Loading branch information
thesan authored Mar 29, 2024
1 parent 801e824 commit dd3e773
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@ import BN from 'bn.js'
import React from 'react'

import { NumericValueStat } from '@/common/components/statistics'
import { TextSmall } from '@/common/components/typography'

interface Props {
label: string
value: BN
units?: string
}

export const Numeric = ({ label, value }: Props) => <NumericValueStat title={label} value={value} />
export const Numeric = ({ label, value, units }: Props) => (
<NumericValueStat title={label} value={value}>
{units && (
<TextSmall as="span" lighter>
{' '}
{units}
</TextSmall>
)}
</NumericValueStat>
)

0 comments on commit dd3e773

Please sign in to comment.