mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
* added N/A for negative values as well as missing data * added N/A in teaser for negative orders count * added N/A to profile and asset teaser * change typing on Conversion and PriceUnit * remove log * removed unnecessary check on price value
32 lines
766 B
TypeScript
32 lines
766 B
TypeScript
import React, { ReactElement } from 'react'
|
|
import PriceUnit from './PriceUnit'
|
|
|
|
export default function Price({
|
|
accessDetails,
|
|
orderPriceAndFees,
|
|
className,
|
|
size,
|
|
conversion
|
|
}: {
|
|
accessDetails: AccessDetails
|
|
orderPriceAndFees?: OrderPriceAndFees
|
|
className?: string
|
|
conversion?: boolean
|
|
size?: 'small' | 'mini' | 'large'
|
|
}): ReactElement {
|
|
const isSupported =
|
|
accessDetails?.type === 'fixed' || accessDetails?.type === 'free'
|
|
const price = `${orderPriceAndFees?.price || accessDetails?.price}`
|
|
|
|
return isSupported ? (
|
|
<PriceUnit
|
|
price={Number(price)}
|
|
symbol={accessDetails.baseToken?.symbol}
|
|
className={className}
|
|
size={size}
|
|
conversion={conversion}
|
|
type={accessDetails.type}
|
|
/>
|
|
) : null
|
|
}
|