static-cms/src/components/Widgets/ImagePreview.js
Cássio Souza a4d7622ade Asset API (#204)
Asset API
2017-01-10 22:23:22 -02:00

20 lines
461 B
JavaScript

import React, { PropTypes } from 'react';
import previewStyle, { imagePreviewStyle } from './defaultPreviewStyle';
export default function ImagePreview({ value, getAsset }) {
return (<div style={previewStyle}>
{ value ?
<img
src={getAsset(value)}
style={imagePreviewStyle}
role="presentation"
/>
: null}
</div>);
}
ImagePreview.propTypes = {
getAsset: PropTypes.func.isRequired,
value: PropTypes.node,
};