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

25 lines
610 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;
2022-01-07 20:02:33 +01:00
const src = `file://${source}`;
return (
2020-04-14 01:48:11 +02:00
<div className="file-viewer file-viewer--document" onContextMenu={stopContextMenu}>
<div className="file-viewer file-viewer--iframe">
<IframeReact title={__('File preview')} src={src} />
</div>
</div>
);
}
}
export default PdfViewer;