1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-30 05:41:41 +02:00
market/src/components/molecules/AssetTitle.tsx

21 lines
450 B
TypeScript

import { useMetadata } from '@oceanprotocol/react'
import { Link } from 'gatsby'
import React, { ReactElement } from 'react'
import styles from './AssetTitle.module.css'
export default function AssetTitle({
did,
title
}: {
did?: string
title?: string
}): ReactElement {
const metadata = useMetadata(did)
return (
<h3 className={styles.title}>
<Link to={`/asset/${did}`}>{title || metadata.title || did}</Link>
</h3>
)
}