import React, { ReactElement } from 'react' import { useAsset } from '@context/Asset' import PriceUnit from '@shared/Price/PriceUnit' import Tooltip from '@shared/atoms/Tooltip' import styles from './PriceOutput.module.css' import { MAX_DECIMALS } from '@utils/constants' import Decimal from 'decimal.js' import { useWeb3 } from '@context/Web3' interface PriceOutputProps { hasPreviousOrder: boolean hasDatatoken: boolean symbol: string assetTimeout: string hasPreviousOrderSelectedComputeAsset: boolean hasDatatokenSelectedComputeAsset: boolean algorithmConsumeDetails: AccessDetails algorithmSymbol: string selectedComputeAssetTimeout: string datasetOrderPrice?: string algoOrderPrice?: string providerFeeAmount?: string validUntil?: string totalPrices?: totalPriceMap[] } function Row({ price, hasPreviousOrder, hasDatatoken, symbol, timeout, sign, type }: { price: string hasPreviousOrder?: boolean hasDatatoken?: boolean symbol?: string timeout?: string sign?: string type?: string }) { const { isSupportedOceanNetwork } = useWeb3() return (
{sign}
{type}
{timeout && timeout !== 'Forever' && !hasPreviousOrder && `for ${timeout}`}
) } export default function PriceOutput({ hasPreviousOrder, hasDatatoken, assetTimeout, symbol, hasPreviousOrderSelectedComputeAsset, hasDatatokenSelectedComputeAsset, algorithmConsumeDetails, algorithmSymbol, selectedComputeAssetTimeout, datasetOrderPrice, algoOrderPrice, providerFeeAmount, validUntil, totalPrices }: PriceOutputProps): ReactElement { const { asset } = useAsset() return (
You will pay{' '} {totalPrices.map((item, index) => (
))} {totalPrices.map((item, index) => ( ))}
} /> ) }