visuddhinanda 2 лет назад
Родитель
Сommit
7795cc05a7
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      dashboard/src/components/template/MdView.tsx

+ 4 - 2
dashboard/src/components/template/MdView.tsx

@@ -4,15 +4,17 @@ const { Text } = Typography;
 
 interface IWidget {
   html?: string;
+  placeholder?: string;
   wordWidget?: boolean;
   convertor?: TCodeConvertor;
 }
 const Widget = ({
-  html = "<div></div>",
+  html,
   wordWidget = false,
+  placeholder,
   convertor,
 }: IWidget) => {
-  const jsx = XmlToReact(html, wordWidget, convertor);
+  const jsx = html ? XmlToReact(html, wordWidget, convertor) : placeholder;
   return <Text>{jsx}</Text>;
 };