MdView.tsx 421 B

12345678910111213141516171819
  1. import { Typography } from "antd";
  2. import { TCodeConvertor, XmlToReact } from "./utilities";
  3. const { Text } = Typography;
  4. interface IWidget {
  5. html?: string;
  6. wordWidget?: boolean;
  7. convertor?: TCodeConvertor;
  8. }
  9. const Widget = ({
  10. html = "<div></div>",
  11. wordWidget = false,
  12. convertor,
  13. }: IWidget) => {
  14. const jsx = XmlToReact(html, wordWidget, convertor);
  15. return <Text>{jsx}</Text>;
  16. };
  17. export default Widget;