import React from 'react' import Moment from 'react-moment' import { DDO, MetaData, File } from '@oceanprotocol/squid' import shortid from 'shortid' import Markdown from '../../atoms/Markdown' import CategoryLink from '../../atoms/CategoryLink' import styles from './AssetDetails.module.scss' import AssetFilesDetails from './AssetFilesDetails' import Report from './Report' import { allowPricing } from '../../../config' import Web3 from 'web3' interface AssetDetailsProps { metadata: MetaData ddo: DDO } export function datafilesLine(files: File[]) { if (files.length === 1) { return {files.length} data file } return {files.length} data files } const MetaFixedItem = ({ name, value }: { name: string; value: string }) => (
  • {name} {value}
  • ) export default function AssetDetails({ metadata, ddo }: AssetDetailsProps) { const { base } = metadata const metaFixed = [ { name: 'Author', value: base.author, show: true }, { name: 'License', value: base.license, show: true }, { name: 'DID', value: ddo.id, show: true }, { name: 'Price', value: `${ base.price === '0' ? 0 : Web3.utils.fromWei(base.price.toString()) } OCEAN`, show: allowPricing } ] return ( <> {base.description && ( )}

    Fixed Metadata

      {metaFixed .filter(item => item.show) .map(item => ( ))}
    ) }