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

28 lines
586 B
React
Raw Normal View History

// @flow
import React from 'react';
import { stopContextMenu } from 'util/contextMenu';
type Props = {
source: string,
};
class PdfViewer extends React.PureComponent<Props> {
constructor(props: Props) {
super(props);
this.viewer = React.createRef();
}
viewer: { current: any };
render() {
const { source } = this.props;
return (
<div className="file-render__viewer" onContextMenu={stopContextMenu}>
<webview ref={this.viewer} src={`chrome://pdf-viewer/index.html?src=file://${source}`} />
</div>
);
}
}
export default PdfViewer;