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';
|
2020-04-01 20:43:50 +02:00
|
|
|
import IframeReact from 'component/IframeReact';
|
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> {
|
2019-03-20 05:41:51 +01:00
|
|
|
render() {
|
2019-11-26 20:08:34 +01:00
|
|
|
const { source } = this.props;
|
2022-01-07 20:02:33 +01:00
|
|
|
const src = `file://${source}`;
|
2018-07-05 04:49:12 +02:00
|
|
|
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">
|
2020-04-01 20:43:50 +02:00
|
|
|
<IframeReact title={__('File preview')} src={src} />
|
2019-11-26 20:08:34 +01:00
|
|
|
</div>
|
2018-07-05 07:24:04 +02:00
|
|
|
</div>
|
2018-07-05 04:49:12 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PdfViewer;
|