Skip to content

Commit

Permalink
Add a unit prop to the Numeric proposal details renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
thesan committed Mar 29, 2024
1 parent 801e824 commit 364ef7d
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 364ef7d

Please sign in to comment.