import React from 'react'; import SilverStripeComponent from 'lib/SilverStripeComponent'; /** * Renders the right-hand collapsable change preview panel */ class Preview extends SilverStripeComponent { render() { // @todo - Multiple preview views with toggle slider let body = null; if (!this.props.previewUrl) { body = (

There is no preview available for this item.

); } else if (this.props.previewType.indexOf('image/') === 0) { body = (
{this.props.previewUrl}
); } else { body = ; } return (
{body}
); } } Preview.propTypes = { previewUrl: React.PropTypes.string.isRequired, previewType: React.PropTypes.string, // Mime type }; export default Preview;