mango-ui-v3/components/SideBadge.tsx

27 lines
609 B
TypeScript
Raw Normal View History

import React, { FunctionComponent } from 'react'
import { useTranslation } from 'next-i18next'
2022-01-31 07:52:28 -08:00
import { capitalize } from 'lodash'
type SideBadgeProps = {
side: string
}
const SideBadge: FunctionComponent<SideBadgeProps> = ({ side }) => {
const { t } = useTranslation('common')
return (
<div
className={`rounded inline-block ${
side === 'buy' || side === 'long'
? 'border border-th-green text-th-green'
: 'border border-th-red text-th-red'
}
px-2 py-0.5 -my-0.5 text-xs`}
>
2022-01-31 07:52:28 -08:00
{capitalize(t(side))}
</div>
)
}
export default SideBadge