17 lines
416 B
JavaScript
Raw Normal View History

2018-07-24 13:57:57 -04:00
import React from 'react';
import PropTypes from 'prop-types';
import { WidgetPreviewContainer } from 'netlify-cms-ui-default';
const FilePreview = ({ value, getAsset }) => (
<WidgetPreviewContainer>
{value ? <a href={getAsset(value)}>{value}</a> : null}
2018-07-24 13:57:57 -04:00
</WidgetPreviewContainer>
);
FilePreview.propTypes = {
getAsset: PropTypes.func.isRequired,
value: PropTypes.node,
};
export default FilePreview;