lbry-desktop/src/ui/component/viewers/pdfViewer.jsx

21 lines
455 B
React
Raw Normal View History

// @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';
type Props = {
source: string,
};
class PdfViewer extends React.PureComponent<Props> {
render() {
const { source } = this.props;
return (
<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}`} />
</div>
);
}
}
export default PdfViewer;