1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00
commons/src/components/molecules/Asset.tsx

28 lines
794 B
TypeScript
Raw Normal View History

2019-02-13 17:03:26 +01:00
import React from 'react'
import { Link } from 'react-router-dom'
import styles from './Asset.module.scss'
const AssetLink = ({ asset }: { asset: any }) => {
const { metadata } = asset.findServiceByType('Metadata')
2019-02-15 14:43:15 +01:00
const { base } = metadata
2019-02-13 17:03:26 +01:00
return (
<article className={styles.asset}>
<Link to={`/asset/${asset.id}`}>
2019-02-15 14:43:15 +01:00
<h1>{base.name}</h1>
<p>{base.description.substring(0, 90)}</p>
2019-02-13 17:03:26 +01:00
<footer className={styles.assetFooter}>
2019-02-15 14:43:15 +01:00
{base.categories ? (
<div>{base.category}</div>
) : (
<div>Fake Category</div>
)}
2019-02-13 17:03:26 +01:00
</footer>
</Link>
</article>
)
}
export default AssetLink