forked from accordproject/template-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAgreementHtml.tsx
More file actions
87 lines (84 loc) · 2.07 KB
/
AgreementHtml.tsx
File metadata and controls
87 lines (84 loc) · 2.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { LoadingOutlined } from "@ant-design/icons";
import { Spin } from "antd";
import useAppStore from "./store/store";
import FullScreenModal from "./components/FullScreenModal";
function AgreementHtml({
loading,
isModal,
}: {
loading: any;
isModal?: boolean;
}) {
const agreementHtml = useAppStore((state) => state.agreementHtml);
const backgroundColor = useAppStore((state) => state.backgroundColor);
const textColor = useAppStore((state) => state.textColor);
return (
<div
className="column preview-component"
style={{
border: "1px solid #d9d9d9",
borderRadius: "8px",
padding: "16px",
height: "calc(100vh - 64px)",
overflowY: "auto",
display: "flex",
flexDirection: "column",
}}
>
<div
style={{
width: "100%",
display: "flex",
textAlign: "center",
color: textColor,
}}
>
<h2
style={{
flexGrow: 1,
textAlign: "center",
paddingLeft: "34px",
color: textColor,
}}
>
Preview Output
</h2>
{!isModal && <FullScreenModal />}
</div>
<p style={{ textAlign: "center", color: textColor }}>
The result of merging the JSON data with the template. This is
AgreementMark converted to HTML.
</p>
{loading ? (
<div
style={{
flex: 1,
display: "flex",
justifyContent: "center",
alignItems: "center",
}}
>
<Spin
indicator={
<LoadingOutlined
style={{ fontSize: 42, color: "#19c6c7" }}
spin
/>
}
/>
</div>
) : (
<div
className="agreement"
dangerouslySetInnerHTML={{ __html: agreementHtml }}
style={{
flex: 1,
color: textColor,
backgroundColor: backgroundColor,
}}
/>
)}
</div>
);
}
export default AgreementHtml;