aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/WebView.tsx
blob: 5cc85eb28118b1346ed539fb1ca01a93dc78040d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { FieldViewProps, FieldView } from "./FieldView";
import { computed } from "mobx";
import { observer } from "mobx-react";
import { KeyStore } from "../../../fields/KeyStore";
import React = require('react')
import { HtmlField } from "../../../fields/HtmlField";

@observer
export class WebView extends React.Component<FieldViewProps> {
    public static LayoutString(fieldStr: string = "DataKey") { return FieldView.LayoutString(WebView, fieldStr) }

    @computed
    get html(): string {
        return this.props.doc.GetData(KeyStore.Data, HtmlField, "" as string);
    }

    render() {
        return <span dangerouslySetInnerHTML={{ __html: this.html }}></span>
    }
}