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>
|
2018-08-07 14:46:54 -06:00
|
|
|
{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;
|