scratch-www/src/views/preview/extension-chip.jsx

31 lines
809 B
React
Raw Normal View History

2018-06-13 14:53:41 -04:00
const classNames = require('classnames');
const React = require('react');
2018-06-13 14:53:41 -04:00
const PropTypes = require('prop-types');
require('./extension-chip.scss');
2018-06-13 14:53:41 -04:00
const ExtensionChip = props => (
<div className={classNames('extension-chip', {'has-status': props.hasStatus})}>
<img
2018-06-13 15:32:31 -04:00
className="extension-icon"
src={props.iconURI}
/>
<div className="extension-content">
2018-06-13 14:53:41 -04:00
<span>{props.extensionName}</span>
{props.hasStatus && (
<div className="extension-status">
Needs Connection
</div>
)}
</div>
</div>
);
2018-06-13 14:53:41 -04:00
ExtensionChip.propTypes = {
extensionName: PropTypes.string,
hasStatus: PropTypes.boolean,
iconURI: PropTypes.string
2018-06-13 14:53:41 -04:00
};
module.exports = ExtensionChip;