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

25 lines
660 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';
import IframeReact from 'component/IframeReact';
type Props = {
source: string,
};
class PdfViewer extends React.PureComponent<Props> {
2019-03-20 05:41:51 +01:00
render() {
const { source } = this.props;
const src = IS_WEB ? source : `file://${source}`;
return (
<div className="file-render__viewer file-render__viewer--document" onContextMenu={stopContextMenu}>
<div className="file-render__viewer file-render__viewer--iframe">
<IframeReact title={__('File preview')} src={src} />
</div>
</div>
);
}
}
export default PdfViewer;