2018-07-05 04:49:12 +02:00
|
|
|
// @flow
|
2018-10-15 08:26:46 +02:00
|
|
|
import * as React from 'react';
|
2018-11-21 22:20:55 +01:00
|
|
|
import { stopContextMenu } from 'util/context-menu';
|
2018-07-05 04:49:12 +02:00
|
|
|
|
|
|
|
type Props = {
|
2018-08-02 02:53:38 +02:00
|
|
|
source: string,
|
2018-07-05 04:49:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class PdfViewer extends React.PureComponent<Props> {
|
|
|
|
render() {
|
|
|
|
const { source } = this.props;
|
|
|
|
return (
|
2018-08-02 02:53:38 +02:00
|
|
|
<div className="file-render__viewer" onContextMenu={stopContextMenu}>
|
2018-10-15 08:26:46 +02:00
|
|
|
<webview src={`chrome://pdf-viewer/index.html?src=file://${source}`} />
|
2018-07-05 07:24:04 +02:00
|
|
|
</div>
|
2018-07-05 04:49:12 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PdfViewer;
|