Explorar el Código

<span> -> <Text>

visuddhinanda hace 2 años
padre
commit
5c7365a0cf
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      dashboard/src/components/template/Wbw/PaliText.tsx

+ 6 - 1
dashboard/src/components/template/Wbw/PaliText.tsx

@@ -1,4 +1,5 @@
 import { useEffect, useState } from "react";
 import { useEffect, useState } from "react";
+import { Typography } from "antd";
 
 
 import { useAppSelector } from "../../../hooks";
 import { useAppSelector } from "../../../hooks";
 import { settingInfo } from "../../../reducers/setting";
 import { settingInfo } from "../../../reducers/setting";
@@ -11,7 +12,10 @@ import { roman_to_si } from "../../code/si";
 import { roman_to_thai } from "../../code/thai";
 import { roman_to_thai } from "../../code/thai";
 import { roman_to_taitham } from "../../code/tai-tham";
 import { roman_to_taitham } from "../../code/tai-tham";
 
 
+const { Text } = Typography;
+
 interface IWidget {
 interface IWidget {
+  style?: React.CSSProperties;
   text?: string;
   text?: string;
   code?: string;
   code?: string;
   primary?: boolean;
   primary?: boolean;
@@ -19,6 +23,7 @@ interface IWidget {
 }
 }
 const PaliTextWidget = ({
 const PaliTextWidget = ({
   text,
   text,
+  style,
   code = "roman",
   code = "roman",
   primary = true,
   primary = true,
   termToLocal = true,
   termToLocal = true,
@@ -71,7 +76,7 @@ const PaliTextWidget = ({
       }
       }
     }
     }
   }, [text, settings, code]);
   }, [text, settings, code]);
-  return text ? <span>{paliText}</span> : <></>;
+  return text ? <Text style={style}>{paliText}</Text> : <></>;
 };
 };
 
 
 export default PaliTextWidget;
 export default PaliTextWidget;