visuddhinanda 2 лет назад
Родитель
Сommit
d5fd719a10
1 измененных файлов с 3 добавлено и 13 удалено
  1. 3 13
      dashboard/src/components/dict/WordCardByDict.tsx

+ 3 - 13
dashboard/src/components/dict/WordCardByDict.tsx

@@ -1,7 +1,8 @@
 import { Card } from "antd";
 import { Typography } from "antd";
+import MdView from "../template/MdView";
 
-import IWidgetGrammarPop from "./GrammarPop";
+import GrammarPop from "./GrammarPop";
 
 const { Title, Text } = Typography;
 
@@ -21,18 +22,7 @@ const WordCardByDictWidget = (prop: IWidgetWordCardByDict) => {
         {prop.data.dictname}
       </Title>
       <div>
-        <Text>
-          {prop.data.note.split("|").map((it, id) => {
-            if (it.slice(0, 1) === "@") {
-              const [showText, keyText] = it.slice(1).split("-");
-              return (
-                <IWidgetGrammarPop key={id} gid={keyText} text={showText} />
-              );
-            } else {
-              return <span key={id * 200}>{it}</span>;
-            }
-          })}
-        </Text>
+        <MdView html={prop.data.note} />
       </div>
     </Card>
   );