Răsfoiți Sursa

add placeholder

visuddhinanda 2 ani în urmă
părinte
comite
7795cc05a7
1 a modificat fișierele cu 4 adăugiri și 2 ștergeri
  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>;
 };