mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
* Free Pricing Option at create Pricing (#621) * Free Pricing Option + env var toggle * Create Pricing step msg * Default 'allowFreePricing' to true temp for review * Fix price 0 on free tab * Attempt fix useSiteMetadata * Fix linting * Feature/free price support consume compute (#654) * Update fetch free price * Feedback change UI remove 0's * update button msg && fix * compute algorithm list show 'Free' instead of '0' * updateMetadata() v3 workaround solution for free pricing (#677) * compute algorithm list show 'Free' instead of '0' * workaround editMetaData free price * utils function for compute & download * `allowFreePricing` default to false
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import React, { ReactElement } from 'react'
|
|
import styles from './index.module.css'
|
|
import { BestPrice } from '@oceanprotocol/lib'
|
|
import Loader from '../Loader'
|
|
import Tooltip from '../Tooltip'
|
|
import PriceUnit from './PriceUnit'
|
|
|
|
export default function Price({
|
|
price,
|
|
className,
|
|
small,
|
|
conversion
|
|
}: {
|
|
price: BestPrice
|
|
className?: string
|
|
small?: boolean
|
|
conversion?: boolean
|
|
}): ReactElement {
|
|
return price?.value || price?.type === 'free' ? (
|
|
<PriceUnit
|
|
price={`${price.value}`}
|
|
className={className}
|
|
small={small}
|
|
conversion={conversion}
|
|
type={price.type}
|
|
/>
|
|
) : !price || price?.type === '' ? (
|
|
<div className={styles.empty}>
|
|
No price set{' '}
|
|
<Tooltip content="No pricing mechanism has been set on this asset yet." />
|
|
</div>
|
|
) : (
|
|
// TODO: Hacky hack, put back some check for low liquidity
|
|
// ) : price.isConsumable !== 'true' ? (
|
|
// <div className={styles.empty}>
|
|
// Low liquidity{' '}
|
|
// <Tooltip content="This pool does not have enough liquidity for using this data set." />
|
|
// </div>
|
|
<Loader message="Retrieving price..." />
|
|
)
|
|
}
|