mirror of
https://github.com/oceanprotocol/react.git
synced 2025-02-14 21:10:38 +01:00
23 lines
471 B
TypeScript
23 lines
471 B
TypeScript
import React from 'react'
|
|
import { useMetadata } from '@oceanprotocol/react'
|
|
import { DDO } from '@oceanprotocol/lib'
|
|
|
|
export function MetadataExample({ ddo }: { ddo: DDO }) {
|
|
const { title, price, did } = useMetadata(ddo)
|
|
|
|
return (
|
|
<>
|
|
<div>
|
|
{title} - did= {did}
|
|
</div>
|
|
<div>
|
|
{price && (
|
|
<span>
|
|
price = {price.value} // {price.type} = {price.address}
|
|
</span>
|
|
)}
|
|
</div>
|
|
</>
|
|
)
|
|
}
|