lbry-desktop/src/ui/component/cardMedia/view.jsx
2019-03-04 23:48:04 -05:00

26 lines
522 B
JavaScript

// @flow
import React from 'react';
import Placeholder from './placeholder.png';
type Props = {
thumbnail: ?string, // externally sourced image
};
class CardMedia extends React.PureComponent<Props> {
render() {
const { thumbnail } = this.props;
return (
<div
style={
thumbnail
? { backgroundImage: `url('${thumbnail}')` }
: { backgroundImage: `url(${Placeholder})` }
}
className="media__thumb"
/>
);
}
}
export default CardMedia;