-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathindex.tsx
More file actions
82 lines (81 loc) · 2.02 KB
/
index.tsx
File metadata and controls
82 lines (81 loc) · 2.02 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
// Copyright 2023 DatabendLabs.
import clsx from "clsx";
import React, { FC, ReactElement, useEffect } from "react";
import styles from "./styles.module.scss";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
interface IProps {
featureTitle?: string;
featureName: string;
wholeDesc?: string;
}
const EEFeature: FC<IProps> = ({
featureName,
wholeDesc,
featureTitle = "ENTERPRISE EDITION FEATURE",
}): ReactElement => {
const {
siteConfig: {
customFields: { isChina },
},
} = useDocusaurusContext() as any;
function A() {
return (
<>
{isChina ? (
<>
如需获取许可证,请
<a target="_blank" href={"https://www.databend.cn/contact-us"}>
联系 Databend 支持团队
</a>
。
</>
) : (
<>
Contact{" "}
<a target="_blank" href={"https://www.databend.com/contact-us"}>
Databend Support
</a>{" "}
for a license.
</>
)}
</>
);
}
useEffect(() => {
const h1 = document
?.querySelector(".theme-doc-markdown")
?.querySelector("header")?.firstChild as HTMLElement;
if (h1) {
h1?.classList?.add("DOCITEM-PAGE-EE-TIPS-BEFORE-DOM");
}
}, []);
return (
<div className="DOCITEM-PAGE-EE-TIPS">
<div className={clsx(styles.wrap)}>
<div className={styles.button}>
{isChina ? "企业版功能" : featureTitle}
</div>
<div className={styles.desc}>
{wholeDesc ? (
<>
{wholeDesc} <A />
</>
) : (
<>
{isChina ? (
<>
{featureName}是企业版功能。 <A />
</>
) : (
<>
{featureName} is an Enterprise Edition feature. <A />
</>
)}
</>
)}
</div>
</div>
</div>
);
};
export default EEFeature;