2021-02-23 11:16:52 +01:00
|
|
|
import React, { ReactElement } from 'react'
|
2021-02-25 09:55:38 +01:00
|
|
|
import styles from './AssetType.module.css'
|
|
|
|
import classNames from 'classnames/bind'
|
2021-02-23 11:16:52 +01:00
|
|
|
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({
|
2021-02-23 11:16:52 +01:00
|
|
|
type,
|
2021-02-25 09:55:38 +01:00
|
|
|
accessType,
|
|
|
|
className
|
2021-02-23 11:16:52 +01:00
|
|
|
}: {
|
|
|
|
type: string
|
|
|
|
accessType: string
|
2021-02-25 09:55:38 +01:00
|
|
|
className?: string
|
2021-02-23 11:16:52 +01:00
|
|
|
}): ReactElement {
|
2021-02-25 09:55:38 +01:00
|
|
|
const styleClasses = cx({
|
|
|
|
[className]: className
|
|
|
|
})
|
2021-02-23 11:16:52 +01:00
|
|
|
return (
|
2021-02-25 09:55:38 +01:00
|
|
|
<div className={styleClasses}>
|
2021-02-23 11:16:52 +01:00
|
|
|
<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>
|
2021-02-23 11:16:52 +01:00
|
|
|
)
|
|
|
|
}
|