2019-03-25 16:17:28 +08:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
2019-03-26 20:04:18 +08:00
|
|
|
import FileView from './components/file-view/file-view';
|
2019-03-25 16:17:28 +08:00
|
|
|
import FileViewTip from './components/file-view/file-view-tip';
|
|
|
|
|
2019-03-26 20:04:18 +08:00
|
|
|
const { err } = window.app.pageOptions;
|
2019-03-25 16:17:28 +08:00
|
|
|
|
|
|
|
class ViewFileUnknown extends React.Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2019-03-26 20:04:18 +08:00
|
|
|
<FileView content={<FileContent />} />
|
2019-03-25 16:17:28 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class FileContent extends React.Component {
|
|
|
|
render() {
|
|
|
|
if (err) {
|
|
|
|
return <FileViewTip />;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ReactDOM.render (
|
|
|
|
<ViewFileUnknown />,
|
|
|
|
document.getElementById('wrapper')
|
|
|
|
);
|