20 lines
454 B
JavaScript
20 lines
454 B
JavaScript
// @flow
|
|
import React from 'react';
|
|
import { stopContextMenu } from 'util/context-menu';
|
|
|
|
type Props = {
|
|
source: string,
|
|
};
|
|
|
|
class HtmlViewer extends React.PureComponent<Props> {
|
|
render() {
|
|
const { source } = this.props;
|
|
return (
|
|
<div className="file-render__viewer" onContextMenu={stopContextMenu}>
|
|
<iframe sandbox="" title={__('File preview')} src={`file://${source}`} />
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default HtmlViewer;
|