forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwindow-view.tsx
More file actions
39 lines (35 loc) · 1.07 KB
/
window-view.tsx
File metadata and controls
39 lines (35 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { PureComponent } from 'react';
import { ResourceView } from './resource-view';
import { engineConfig, observer } from '@felce/lowcode-editor-core';
import { EditorWindow } from '../window';
import { BuiltinLoading } from '@felce/lowcode-designer';
import { DesignerView } from '../inner-plugins/webview';
@observer
export class WindowView extends PureComponent<
{
window: EditorWindow;
active: boolean;
},
any
> {
render() {
const { active } = this.props;
const { resource, initReady, url } = this.props.window;
if (!initReady) {
const Loading = engineConfig.get('loadingComponent', BuiltinLoading);
return (
<div className={`workspace-engine-main ${active ? 'active' : ''}`}>
<Loading />
</div>
);
}
if (resource.type === 'webview' && url) {
return <DesignerView url={url} viewName={resource.name} />;
}
return (
<div className={`workspace-engine-main ${active ? 'active' : ''}`}>
<ResourceView resource={resource} window={this.props.window} />
</div>
);
}
}