market/src/components/atoms/AssetType.tsx

34 lines
900 B
TypeScript
Raw Normal View History

import React, { ReactElement } from 'react'
2021-02-25 09:55:38 +01:00
import styles from './AssetType.module.css'
import classNames from 'classnames/bind'
import { ReactComponent as Compute } from '../../images/compute.svg'
import { ReactComponent as Download } from '../../images/download.svg'
2021-02-25 09:55:38 +01:00
const cx = classNames.bind(styles)
export default function AssetType({
type,
2021-02-25 09:55:38 +01:00
accessType,
className
}: {
type: string
accessType: string
2021-02-25 09:55:38 +01:00
className?: string
}): ReactElement {
2021-02-25 09:55:38 +01:00
const styleClasses = cx({
[className]: className
})
return (
2021-02-25 09:55:38 +01:00
<div className={styleClasses}>
<div className={styles.typeLabel}>
{type === 'dataset' ? 'data set' : 'algorithm'}
</div>
{accessType === 'access' ? (
<Download role="img" aria-label="Download" className={styles.icon} />
) : (
<Compute role="img" aria-label="Compute" className={styles.icon} />
)}
2021-02-25 09:55:38 +01:00
</div>
)
}